Skip to content

Commit

Permalink
t: add "max_nodes" key-value pair to test payloads
Browse files Browse the repository at this point in the history
Problem: Some of the test payloads in the testsuite don't have a
"max_nodes" key-value pair, which is needed by the plugin in order to
enforce limits.

Add "max_nodes" key-value pairs to the test payloads sent to the
priority plugin.
  • Loading branch information
cmoussa1 committed Apr 18, 2024
1 parent 89a3a55 commit aebcb70
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 1 deletion.
7 changes: 7 additions & 0 deletions t/expected/sample_payloads/same_fairshare.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"fairshare": 0.5,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -19,6 +20,7 @@
"fairshare": 0.5,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -32,6 +34,7 @@
"fairshare": 0.5,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -44,6 +47,7 @@
"fairshare": 0.5,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -56,6 +60,7 @@
"fairshare": 0.5,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -68,6 +73,7 @@
"fairshare": 0.5,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -80,6 +86,7 @@
"fairshare": 0.5,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand Down
7 changes: 7 additions & 0 deletions t/expected/sample_payloads/small_no_tie.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"fairshare": 0.285714,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -19,6 +20,7 @@
"fairshare": 0.142857,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -31,6 +33,7 @@
"fairshare": 0.428571,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -43,6 +46,7 @@
"fairshare": 0.714286,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -55,6 +59,7 @@
"fairshare": 0.571429,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -67,6 +72,7 @@
"fairshare": 1.0,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -79,6 +85,7 @@
"fairshare": 0.857143,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand Down
8 changes: 8 additions & 0 deletions t/expected/sample_payloads/small_tie.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"fairshare": 0.5,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -19,6 +20,7 @@
"fairshare": 0.5,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -31,6 +33,7 @@
"fairshare": 0.75,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -43,6 +46,7 @@
"fairshare": 0.5,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -55,6 +59,7 @@
"fairshare": 0.5,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -67,6 +72,7 @@
"fairshare": 0.75,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -79,6 +85,7 @@
"fairshare": 1.0,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -91,6 +98,7 @@
"fairshare": 0.875,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand Down
9 changes: 9 additions & 0 deletions t/expected/sample_payloads/small_tie_all.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"fairshare": 0.666667,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -19,6 +20,7 @@
"fairshare": 0.666667,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -31,6 +33,7 @@
"fairshare": 1,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -43,6 +46,7 @@
"fairshare": 0.666667,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -55,6 +59,7 @@
"fairshare": 0.666667,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -67,6 +72,7 @@
"fairshare": 1,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -79,6 +85,7 @@
"fairshare": 0.666667,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -91,6 +98,7 @@
"fairshare": 0.666667,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -103,6 +111,7 @@
"fairshare": 1,
"max_running_jobs": 5,
"max_active_jobs": 7,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand Down
4 changes: 4 additions & 0 deletions t/t1001-mf-priority-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ test_expect_success 'create fake_payload.py' '
"fairshare": 0.45321,
"max_running_jobs": 10,
"max_active_jobs": 12,
"max_nodes": 1000000,
"queues": "standby,special",
"active": 1,
"projects": "*",
Expand All @@ -63,6 +64,7 @@ test_expect_success 'create fake_payload.py' '
"fairshare": 0.11345,
"max_running_jobs": 10,
"max_active_jobs": 12,
"max_nodes": 1000000,
"queues": "standby",
"active": 1,
"projects": "*",
Expand Down Expand Up @@ -173,6 +175,7 @@ test_expect_success 'pass special key to user/bank struct to nullify information
"fairshare": 0.45321,
"max_running_jobs": -1,
"max_active_jobs": 12,
"max_nodes": 1000000,
"queues": "standby,special",
"active": 1,
"projects": "*",
Expand Down Expand Up @@ -204,6 +207,7 @@ test_expect_success 'resend user/bank information with valid data and successful
"fairshare": 0.45321,
"max_running_jobs": 2,
"max_active_jobs": 4,
"max_nodes": 1000000,
"queues": "standby,special",
"active": 1,
"projects": "*",
Expand Down
10 changes: 9 additions & 1 deletion t/t1005-max-jobs-limits.t
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ test_expect_success 'create fake_user.json' '
"fairshare": 0.45321,
"max_running_jobs": 2,
"max_active_jobs": 4,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -44,6 +45,7 @@ test_expect_success 'create fake_user.json' '
"fairshare": 0.11345,
"max_running_jobs": 1,
"max_active_jobs": 2,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand Down Expand Up @@ -91,7 +93,9 @@ test_expect_success 'submit job while already having max number of running jobs'

test_expect_success 'a job transitioning to job.state.inactive should release a held job (if any)' '
flux job cancel $jobid1 &&
test $(flux jobs -no {state} ${jobid3}) = RUN &&
flux job wait-event -vt 5 $jobid3 alloc &&
flux job info $jobid3 eventlog > eventlog.out &&
grep "alloc" eventlog.out &&
flux job cancel $jobid2 &&
flux job cancel $jobid3
'
Expand Down Expand Up @@ -129,6 +133,7 @@ test_expect_success 'increase the max jobs count of the user' '
"fairshare": 0.45321,
"max_running_jobs": 3,
"max_active_jobs": 4,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand Down Expand Up @@ -181,6 +186,7 @@ test_expect_success 'update max_active_jobs limit' '
"fairshare": 0.45321,
"max_running_jobs": 3,
"max_active_jobs": 5,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand Down Expand Up @@ -241,6 +247,7 @@ test_expect_success 'create another user with the same limits in multiple banks'
"fairshare": 0.45321,
"max_running_jobs": 1,
"max_active_jobs": 2,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -253,6 +260,7 @@ test_expect_success 'create another user with the same limits in multiple banks'
"fairshare": 0.11345,
"max_running_jobs": 1,
"max_active_jobs": 2,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand Down
2 changes: 2 additions & 0 deletions t/t1012-mf-priority-load.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ test_expect_success 'create fake_payload.py' '
"fairshare": 0.45321,
"max_running_jobs": 1,
"max_active_jobs": 3,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand All @@ -51,6 +52,7 @@ test_expect_success 'create fake_payload.py' '
"fairshare": 0.11345,
"max_running_jobs": 1,
"max_active_jobs": 3,
"max_nodes": 1000000,
"queues": "",
"active": 1,
"projects": "*",
Expand Down
1 change: 1 addition & 0 deletions t/t1014-mf-priority-dne.t
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ test_expect_success 'send the user/bank information to the plugin without reprio
"fairshare": 0.45321,
"max_running_jobs": 10,
"max_active_jobs": 12,
"max_nodes": 1000000,
"queues": "standby,special",
"active": 1,
"projects": "*",
Expand Down

0 comments on commit aebcb70

Please sign in to comment.