Skip to content

Commit

Permalink
testsuite: add test for sched hello failure
Browse files Browse the repository at this point in the history
Problem: there is no test coverage for a failure of the
sched hello callback.

Add a test that ensures a job whose resources cannot be re-allocated
receives a fatal exception.
  • Loading branch information
garlick committed Jan 29, 2023
1 parent 9b45dd8 commit 6ed2497
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions t/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ TESTSCRIPTS = \
t2280-job-memo.t \
t2300-sched-simple.t \
t2302-sched-simple-up-down.t \
t2303-sched-hello.t \
t2310-resource-module.t \
t2311-resource-drain.t \
t2312-resource-exclude.t \
Expand Down
43 changes: 43 additions & 0 deletions t/t2303-sched-hello.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/sh

test_description='test sched hello
Ensure that a job that the scheduler rejects during hello processing
receives a fatal exception.
'

# Append --logfile option if FLUX_TESTS_LOGFILE is set in environment:
test -n "$FLUX_TESTS_LOGFILE" && set -- "$@" --logfile
. $(dirname $0)/sharness.sh

test_under_flux 1 job

test_expect_success 'start a long-running job' '
jobid=$(flux mini submit -n1 -t1h sleep 3600)
'
test_expect_success 'unload scheduler' '
flux module remove sched-simple
'
test_expect_success 'exclude the job node from configuration' '
flux config load <<-EOT
[resource]
exclude = "0"
EOT
'
test_expect_success 'increase broker stderr log level' '
flux setattr log-stderr-level 6
'
test_expect_success 'load scheduler' '
flux module load sched-simple
'
test_expect_success 'job receives exception' '
flux job wait-event -t 30 ${jobid} exception
'
test_expect_success 'job receives clean event' '
flux job wait-event -v -t 30 ${jobid} clean
'
test_expect_success 'decrease broker stderr log level' '
flux setattr log-stderr-level 5
'

test_done

0 comments on commit 6ed2497

Please sign in to comment.