Skip to content

Commit 04a558d

Browse files
author
Himani Anil Deshpande
committed
add time before job 2 submission
1 parent 0d4981e commit 04a558d

2 files changed

Lines changed: 22 additions & 14 deletions

File tree

tests/integration-tests/tests/common/scaling_common.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,11 @@ def setup_create_fleet_override_to_emulate_ice(
414414
"""
415415
ice_instance_types = [f"ICE-{it}" for it in instance_types]
416416
overrides = _build_create_fleet_override(cluster_name, queue, compute_resource, ice_instance_types, subnet_id)
417-
logging.info("Writing create_fleet_overrides.json with invalid InstanceTypes to emulate ICE "
418-
"for queue=%s, cr=%s", queue, compute_resource)
417+
logging.info(
418+
"Writing create_fleet_overrides.json with invalid InstanceTypes to emulate ICE " "for queue=%s, cr=%s",
419+
queue,
420+
compute_resource,
421+
)
419422
_write_json_override(remote_command_executor, CREATE_FLEET_OVERRIDES_PATH, overrides)
420423

421424

@@ -430,6 +433,10 @@ def recover_create_fleet_override_from_ice(
430433
call succeeds.
431434
"""
432435
overrides = _build_create_fleet_override(cluster_name, queue, compute_resource, real_instance_types, subnet_id)
433-
logging.info("Recovering from ICE: writing real InstanceTypes=%s in create_fleet_overrides.json "
434-
"for queue=%s, cr=%s", real_instance_types, queue, compute_resource)
436+
logging.info(
437+
"Recovering from ICE: writing real InstanceTypes=%s in create_fleet_overrides.json " "for queue=%s, cr=%s",
438+
real_instance_types,
439+
queue,
440+
compute_resource,
441+
)
435442
_write_json_override(remote_command_executor, CREATE_FLEET_OVERRIDES_PATH, overrides)

tests/integration-tests/tests/schedulers/test_slurm.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ def _submit_jobs_and_simulate_ice(common_cluster_details, jobs):
659659
"other_options": f"{requeue_opt}--exclusive",
660660
}
661661
)
662+
time.sleep(10)
662663
logging.info("Submitted %s (%s) ID: %s", job["label"], job_type, jid)
663664
job_ids.append(jid)
664665

@@ -770,26 +771,26 @@ def test_expedited_requeue(
770771
}
771772

772773
# Submit 3 jobs in a single ICE cycle:
773-
# job1 (normal), job2 (expedited), job3 (expedited)
774+
# job1 (expedited), job2 (normal), job3 (expedited)
775+
# TODO: Improve the test by making Job 2 as expedited and Job 1 as normal
776+
# so that its clear that Job 2 goes at the top of the queue
774777
jobs = [
775-
{"label": "job1", "expedited": False},
776-
{"label": "job2", "expedited": True},
778+
{"label": "job1", "expedited": True},
779+
{"label": "job2", "expedited": False},
777780
# {"label": "job3", "expedited": True},
778781
]
779782
job_ids = _submit_jobs_and_simulate_ice(common_cluster_details, jobs)
780783
_recover_from_ice_and_wait_for_jobs(common_cluster_details, job_ids)
781784
start_epochs = _collect_start_epochs(remote_command_executor, job_ids)
782785

783786
# Expected ordering after ICE recovery:
784-
# Expedited jobs (job2, job3) run first in submission order, then normal job (job1) last
787+
# Expedited jobs (job1, job3) run first in submission order, then normal job (job2) last
785788
logging.info("Start epochs: %s", dict(zip([j["label"] for j in jobs], start_epochs)))
786789

787-
788-
assert_that(start_epochs[2]).is_less_than_or_equal_to(start_epochs[1]) # job2 (expedited) before job1 (normal)
789-
# assert_that(start_epochs[3]).is_less_than_or_equal_to(start_epochs[1]) # job3 (expedited) before job1 (normal)
790-
# assert_that(start_epochs[2]).is_less_than_or_equal_to(start_epochs[3]) # job2 (expedited) before job3 (expedited)
791-
logging.info("Verified: expedited jobs (job2, job3) ran before normal job (job1)")
792-
790+
assert_that(start_epochs[0]).is_less_than_or_equal_to(start_epochs[1]) # job1 (expedited) before job2 (normal)
791+
# assert_that(start_epochs[2]).is_less_than_or_equal_to(start_epochs[1]) # job3 (expedited) before job2 (normal)
792+
# assert_that(start_epochs[0]).is_less_than_or_equal_to(start_epochs[2]) # job1 (expedited) before job3 (expedited)
793+
logging.info("Verified: expedited jobs (job1) ran before normal job (job1)")
793794

794795

795796
@pytest.mark.usefixtures("region", "os", "instance", "scheduler")

0 commit comments

Comments
 (0)