Skip to content

Commit

Permalink
t1020: convert spaces to tabs
Browse files Browse the repository at this point in the history
Problem: t1020-mf-priority-issue262.t uses spaces instead of tabs, which
is inconsistent with the rest of the sharness tests in flux-accounting.

Convert the spaces to tabs in this test file.
  • Loading branch information
cmoussa1 committed May 28, 2024
1 parent cd82298 commit 41bfb79
Showing 1 changed file with 51 additions and 51 deletions.
102 changes: 51 additions & 51 deletions t/t1020-mf-priority-issue262.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,102 +21,102 @@ test_expect_success 'allow guest access to testexec' '
EOF
'
test_expect_success 'create flux-accounting DB' '
flux account -p $(pwd)/FluxAccountingTest.db create-db
flux account -p $(pwd)/FluxAccountingTest.db create-db
'

test_expect_success 'start flux-accounting service' '
flux account-service -p ${DB_PATH} -t
flux account-service -p ${DB_PATH} -t
'

test_expect_success 'load multi-factor priority plugin' '
flux jobtap load -r .priority-default ${MULTI_FACTOR_PRIORITY}
flux jobtap load -r .priority-default ${MULTI_FACTOR_PRIORITY}
'

test_expect_success 'check that mf_priority plugin is loaded' '
flux jobtap list | grep mf_priority
flux jobtap list | grep mf_priority
'

test_expect_success 'add some banks to the DB' '
flux account add-bank root 1 &&
flux account add-bank --parent-bank=root account1 1 &&
flux account add-bank --parent-bank=root account2 1 &&
flux account add-bank --parent-bank=root account3 1
flux account add-bank root 1 &&
flux account add-bank --parent-bank=root account1 1 &&
flux account add-bank --parent-bank=root account2 1 &&
flux account add-bank --parent-bank=root account3 1
'

test_expect_success 'add a user with two different banks to the DB' '
flux account add-user --username=user1001 --userid=1001 --bank=account1 --max-running-jobs=5 --max-active-jobs=10 &&
flux account add-user --username=user1001 --userid=1001 --bank=account2
flux account add-user --username=user1001 --userid=1001 --bank=account1 --max-running-jobs=5 --max-active-jobs=10 &&
flux account add-user --username=user1001 --userid=1001 --bank=account2
'

test_expect_success 'send flux-accounting DB information to the plugin' '
flux account-priority-update -p $(pwd)/FluxAccountingTest.db
flux account-priority-update -p $(pwd)/FluxAccountingTest.db
'

test_expect_success 'submit a sleep 180 job and ensure it is running' '
jobid1=$(flux python ${SUBMIT_AS} 1001 sleep 180) &&
flux job wait-event -vt 60 $jobid1 alloc &&
flux job info $jobid1 eventlog > eventlog.out &&
grep "alloc" eventlog.out
jobid1=$(flux python ${SUBMIT_AS} 1001 sleep 180) &&
flux job wait-event -vt 60 $jobid1 alloc &&
flux job info $jobid1 eventlog > eventlog.out &&
grep "alloc" eventlog.out
'

test_expect_success 'stop scheduler from allocating resources to jobs' '
flux queue stop
flux queue stop
'

test_expect_success 'submit 2 more sleep 180 jobs; ensure both are in SCHED state' '
jobid2=$(flux python ${SUBMIT_AS} 1001 sleep 180) &&
jobid3=$(flux python ${SUBMIT_AS} 1001 sleep 180) &&
flux job wait-event -vt 60 $jobid2 priority &&
flux job info $jobid2 eventlog > eventlog.out &&
grep "priority" eventlog.out &&
flux job wait-event -vt 60 $jobid3 priority &&
flux job info $jobid3 eventlog > eventlog.out &&
grep "priority" eventlog.out
jobid2=$(flux python ${SUBMIT_AS} 1001 sleep 180) &&
jobid3=$(flux python ${SUBMIT_AS} 1001 sleep 180) &&
flux job wait-event -vt 60 $jobid2 priority &&
flux job info $jobid2 eventlog > eventlog.out &&
grep "priority" eventlog.out &&
flux job wait-event -vt 60 $jobid3 priority &&
flux job info $jobid3 eventlog > eventlog.out &&
grep "priority" eventlog.out
'

test_expect_success 'ensure current running and active jobs are correct: 1 running, 3 active' '
flux jobtap query mf_priority.so > query_1.json &&
test_debug "jq -S . <query_1.json" &&
jq -e ".mf_priority_map[0].banks[0].cur_run_jobs == 1" <query_1.json &&
jq -e ".mf_priority_map[0].banks[0].cur_active_jobs == 3" <query_1.json
flux jobtap query mf_priority.so > query_1.json &&
test_debug "jq -S . <query_1.json" &&
jq -e ".mf_priority_map[0].banks[0].cur_run_jobs == 1" <query_1.json &&
jq -e ".mf_priority_map[0].banks[0].cur_active_jobs == 3" <query_1.json
'

test_expect_success 'update the plugin and ensure current running and active jobs are correct' '
flux account-priority-update -p $(pwd)/FluxAccountingTest.db &&
flux jobtap query mf_priority.so > query_2.json &&
test_debug "jq -S . <query_2.json" &&
jq -e ".mf_priority_map[0].banks[0].cur_run_jobs == 1" <query_2.json &&
jq -e ".mf_priority_map[0].banks[0].cur_active_jobs == 3" <query_2.json
flux account-priority-update -p $(pwd)/FluxAccountingTest.db &&
flux jobtap query mf_priority.so > query_2.json &&
test_debug "jq -S . <query_2.json" &&
jq -e ".mf_priority_map[0].banks[0].cur_run_jobs == 1" <query_2.json &&
jq -e ".mf_priority_map[0].banks[0].cur_active_jobs == 3" <query_2.json
'

test_expect_success 'change the priority of one of the jobs' '
flux job urgency $jobid2 31 &&
flux account-priority-update -p $(pwd)/FluxAccountingTest.db &&
flux job eventlog $jobid2 | grep ^priority | tail -n 1 | priority=4294967295
flux job urgency $jobid2 31 &&
flux account-priority-update -p $(pwd)/FluxAccountingTest.db &&
flux job eventlog $jobid2 | grep ^priority | tail -n 1 | priority=4294967295
'

test_expect_success 'ensure job counts are still the same: 1 running, 3 active' '
flux jobtap query mf_priority.so > query_3.json &&
test_debug "jq -S . <query_3.json" &&
jq -e ".mf_priority_map[0].banks[0].cur_run_jobs == 1" <query_3.json &&
jq -e ".mf_priority_map[0].banks[0].cur_active_jobs == 3" <query_3.json
flux jobtap query mf_priority.so > query_3.json &&
test_debug "jq -S . <query_3.json" &&
jq -e ".mf_priority_map[0].banks[0].cur_run_jobs == 1" <query_3.json &&
jq -e ".mf_priority_map[0].banks[0].cur_active_jobs == 3" <query_3.json
'

test_expect_success 'cancel one of the scheduled jobs, check job counts are correct: 1 running, 2 active' '
flux job cancel $jobid2 &&
flux jobtap query mf_priority.so > query_4.json &&
test_debug "jq -S . <query_4.json" &&
jq -e ".mf_priority_map[0].banks[0].cur_run_jobs == 1" <query_4.json &&
jq -e ".mf_priority_map[0].banks[0].cur_active_jobs == 2" <query_4.json
flux job cancel $jobid2 &&
flux jobtap query mf_priority.so > query_4.json &&
test_debug "jq -S . <query_4.json" &&
jq -e ".mf_priority_map[0].banks[0].cur_run_jobs == 1" <query_4.json &&
jq -e ".mf_priority_map[0].banks[0].cur_active_jobs == 2" <query_4.json
'

test_expect_success 'cancel sleep 180 job(s), check job counts: 0 running, 0 active' '
flux job cancel $jobid1 &&
flux job cancel $jobid3 &&
flux jobtap query mf_priority.so > query_5.json &&
test_debug "jq -S . <query_5.json" &&
jq -e ".mf_priority_map[0].banks[0].cur_run_jobs == 0" <query_5.json &&
jq -e ".mf_priority_map[0].banks[0].cur_active_jobs == 0" <query_5.json
flux job cancel $jobid1 &&
flux job cancel $jobid3 &&
flux jobtap query mf_priority.so > query_5.json &&
test_debug "jq -S . <query_5.json" &&
jq -e ".mf_priority_map[0].banks[0].cur_run_jobs == 0" <query_5.json &&
jq -e ".mf_priority_map[0].banks[0].cur_active_jobs == 0" <query_5.json
'

test_done

0 comments on commit 41bfb79

Please sign in to comment.