From a9808c3fb553177946338071bce9066d6d3170b1 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Mon, 29 Apr 2024 20:01:00 -0700 Subject: [PATCH] test: add unreservable job test problem: ensure we don't end up with unreservable jobs treated as unsatisfiable again solution: add a test that runs three jobs that are only allowed to run on the same resource, and each take all remaining time. This forces jobs two and three to be unreservable until one completes. It's technically sensitive to timing, but in this constrained case I would be surprised if it proves to be flaky. Still should set something up we can use in sharness for setting up jobs that wait on a trigger on a domain socket so we can easily make this kind of test fully deterministic. --- t/CMakeLists.txt | 1 + t/t4013-unreservable.sh | 72 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100755 t/t4013-unreservable.sh diff --git a/t/CMakeLists.txt b/t/CMakeLists.txt index 4fb5f9bb1..9b0d5fa52 100644 --- a/t/CMakeLists.txt +++ b/t/CMakeLists.txt @@ -80,6 +80,7 @@ set(ALL_TESTS t4010-match-conf.t t4011-match-duration.t t4012-set-status.t + t4013-unreservable.sh t5000-valgrind.t t5100-issues-test-driver.t t6000-graph-size.t diff --git a/t/t4013-unreservable.sh b/t/t4013-unreservable.sh new file mode 100755 index 000000000..c83e0c6a5 --- /dev/null +++ b/t/t4013-unreservable.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +# + +test_description=' +' + +. `dirname $0`/sharness.sh + +export TEST_UNDER_FLUX_QUORUM=1 +export TEST_UNDER_FLUX_START_MODE=leader +rpc() { + flux python -c \ + "import flux, json; print(flux.Flux().rpc(\"$1\").get_str())" +} + +test_under_flux 16384 system + +test_expect_success 'unload sched-simple' ' + flux module remove -f sched-simple +' + +test_expect_success 'update configuration' ' + flux config load <<-'EOF' + [[resource.config]] + hosts = "fake[0-10]" + cores = "0-63" + gpus = "0-3" + + [[resource.config]] + hosts = "fake[0-10]" + properties = ["compute"] + + [sched-fluxion-qmanager] + queue-policy = "easy" + + [sched-fluxion-resource] + match-policy = "firstnodex" + prune-filters = "ALL:core,ALL:gpu,cluster:node,rack:node" + match-format = "rv1_nosched" + EOF +' + +test_expect_success 'reload resource with monitor-force-up' ' + flux module reload -f resource noverify monitor-force-up +' +test_expect_success 'load fluxion modules' ' + flux module load sched-fluxion-resource && + flux module load sched-fluxion-qmanager +' +test_expect_success 'wait for fluxion to be ready' ' + flux python -c \ + "import flux, json; print(flux.Flux().rpc(\"sched.resource-status\").get_str())" +' +test_expect_success 'create 3 jobs with the same constraint, so two are unreservable' ' + flux submit --cc=1-3 --quiet \ + -N 1 --exclusive \ + --requires="host:fake[5]" \ + --progress --jps \ + --flags=waitable \ + --setattr=exec.test.run_duration=0.01s \ + sleep 0.25 +' + +test_expect_success 'ensure all three succeeded' ' + flux job wait -av +' +test_expect_success 'unload fluxion' ' + flux module remove sched-fluxion-qmanager && + flux module remove sched-fluxion-resource && + flux module load sched-simple +' +test_done \ No newline at end of file