Skip to content

Commit 9bd30e0

Browse files
committed
Add check that slurm state remains the same after deleting the cluster id state
1 parent 106ba30 commit 9bd30e0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/integration-tests/tests/schedulers/test_slurm_accounting.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,30 @@ def test_slurm_accounting(
179179
cluster = clusters_factory(cluster_config)
180180

181181
remote_command_executor = RemoteCommandExecutor(cluster)
182+
scheduler_commands = scheduler_commands_factory(remote_command_executor)
182183

183184
_test_that_slurmdbd_is_not_running(remote_command_executor)
184185

186+
job_1_id = scheduler_commands.submit_command_and_assert_job_accepted(
187+
submit_command_args={
188+
"command": "srun sleep 600",
189+
"nodes": 10,
190+
"other_options": "--exclusive",
191+
}
192+
)
193+
194+
job_2_id = scheduler_commands.submit_command_and_assert_job_accepted(
195+
submit_command_args={
196+
"command": "srun sleep 600",
197+
"nodes": 10,
198+
"other_options": "--exclusive",
199+
}
200+
)
201+
202+
scheduler_commands.wait_job_running(job_1_id)
203+
scheduler_commands.assert_job_state(job_1_id, "RUNNING")
204+
scheduler_commands.assert_job_state(job_2_id, "PENDING")
205+
185206
# Then update the cluster to enable Slurm Accounting
186207
updated_config_file = pcluster_config_reader(
187208
config_file="pcluster.config.update.yaml",
@@ -195,6 +216,11 @@ def test_slurm_accounting(
195216
remote_command_executor = RemoteCommandExecutor(cluster)
196217
scheduler_commands = scheduler_commands_factory(remote_command_executor)
197218

219+
scheduler_commands.assert_job_state(job_1_id, "RUNNING")
220+
scheduler_commands.assert_job_state(job_2_id, "PENDING")
221+
scheduler_commands.cancel_job(job_1_id)
222+
scheduler_commands.cancel_job(job_2_id)
223+
198224
_test_that_slurmdbd_is_running(remote_command_executor)
199225
_test_successful_startup_in_log(remote_command_executor)
200226
_test_slurmdbd_log_exists_in_log_group(cluster)

0 commit comments

Comments
 (0)