Skip to content

Commit

Permalink
testsuite: add test for double-booking
Browse files Browse the repository at this point in the history
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
garlick committed Jul 5, 2023
1 parent 65da8f2 commit 213212a
Show file tree
Hide file tree
Showing 2 changed files with 46 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 @@ -45,6 +45,7 @@ TESTS = \
t1021-qmanager-nodex.t \
t1022-property-constraints.t \
t1023-multiqueue-constraints.t \
t1024-alloc-check.t \
t2000-tree-basic.t \
t2001-tree-real.t \
t3000-jobspec.t \
Expand Down
45 changes: 45 additions & 0 deletions t/t1024-alloc-check.t
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

0 comments on commit 213212a

Please sign in to comment.