forked from flux-framework/flux-sched
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testsuite: add test for double-booking
Problem: there is no test script for ensuring fluxion never allocates the same resources to multiple jobs. Add a sharness script that utilizes the alloc-check plugin to account for allocated resources and catch errors. At this point, it just includes an "expected failure" test for flux-framework#1043.
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
test_description='Check that fluxion never double books resources' | ||
|
||
. `dirname $0`/sharness.sh | ||
|
||
export FLUX_SCHED_MODULE=none | ||
test_under_flux 1 | ||
|
||
test_expect_success 'load fluxion modules' ' | ||
load_resource && | ||
load_qmanager_sync | ||
' | ||
|
||
# Test for flux-framework/flux-sched#1043 | ||
# | ||
test_expect_success 'configure epilog with delay' ' | ||
flux config load <<-EOT && | ||
[job-manager] | ||
epilog.command = [ "flux", "perilog-run", "epilog", "-e", "sleep,2" ] | ||
EOT | ||
flux jobtap load perilog.so | ||
' | ||
test_expect_success 'load alloc-check plugin' ' | ||
flux jobtap load alloc-check.so | ||
' | ||
# Jobs seem to need to be submitted separately to trigger the issue. | ||
test_expect_success 'submit consecutive jobs that exceed their time limit' ' | ||
(for i in $(seq 5); do \ | ||
flux run -N1 -x -t1s sleep 30 || true; \ | ||
done) 2>joberr | ||
' | ||
test_expect_success 'some jobs received timeout exception' ' | ||
grep "job.exception type=timeout" joberr | ||
' | ||
test_expect_failure 'no jobs received alloc-check exception' ' | ||
test_must_fail grep "job.exception type=alloc-check" joberr | ||
' | ||
test_expect_success 'clean up' ' | ||
cleanup_active_jobs | ||
' | ||
test_expect_success 'remove fluxion modules' ' | ||
remove_qmanager && | ||
remove_resource | ||
' | ||
|
||
test_done |