Skip to content

Commit

Permalink
ci: use priority scheduler in e2e tests (#9430)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkunapuli authored May 28, 2024
1 parent 58b31e6 commit 9524dd4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions e2e_tests/tests/cluster/test_job_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


@pytest.mark.e2e_cpu
def test_job_queue_adjust_weight() -> None:
def test_job_queue_adjust_priority() -> None:
sess = api_utils.user_session()
config = conf.tutorials_path("mnist_pytorch/const.yaml")
model = conf.tutorials_path("mnist_pytorch")
Expand All @@ -25,19 +25,19 @@ def test_job_queue_adjust_weight() -> None:
assert ok

ordered_ids = jobs.get_ids()
detproc.check_call(sess, ["det", "job", "update", ordered_ids[0], "--weight", "10"])
detproc.check_call(sess, ["det", "job", "update", ordered_ids[0], "--priority", "10"])

time.sleep(2)
jobs.refresh()
new_weight = jobs.get_job_weight(ordered_ids[0])
assert new_weight == "10"
new_priority = jobs.get_job_priority(ordered_ids[0])
assert new_priority == "10"

detproc.check_call(sess, ["det", "job", "update-batch", f"{ordered_ids[1]}.weight=10"])
detproc.check_call(sess, ["det", "job", "update-batch", f"{ordered_ids[1]}.priority=10"])

time.sleep(2)
jobs.refresh()
new_weight = jobs.get_job_weight(ordered_ids[1])
assert new_weight == "10"
new_priority = jobs.get_job_priority(ordered_ids[1])
assert new_priority == "10"
finally:
# Avoid leaking experiments even if this test fails.
# Leaking experiments can block the cluster and other tests from running other tasks
Expand Down Expand Up @@ -84,9 +84,9 @@ def refresh_until_populated(self, retries: int = 10) -> bool:
def get_ids(self) -> List:
return self.ids

def get_job_weight(self, jobID: str) -> str:
def get_job_priority(self, jobID: str) -> str:
for value_dict in self.values:
if value_dict["ID"] != jobID:
continue
return value_dict["Weight"]
return value_dict["Priority"]
return ""

0 comments on commit 9524dd4

Please sign in to comment.