-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testsuite: add flux-core issue test for housekeeping
Problem: there is no test for flux-core issue flux-framework/flux-core#6179. Add tests in the Fluxion issues directory.
- Loading branch information
Showing
1 changed file
with
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#!/bin/bash | ||
# | ||
# Ensure fluxion calc_factor executes without overflow | ||
# | ||
|
||
log() { printf "flux-coreissue#6179: $@\n" >&2; } | ||
|
||
rpc() { flux python -c "import flux; flux.Flux().rpc(\"$1\").get()"; } | ||
|
||
cat <<'EOF' >free.py | ||
import flux | ||
import json | ||
import sys | ||
import subprocess as sp | ||
from pprint import pprint | ||
jobid=int(sp.check_output(['flux', 'job', 'id', sys.argv[1]]).decode()) | ||
print(jobid) | ||
r_obj=json.loads(sp.check_output(['flux', 'job', 'info', sys.argv[1], 'R']).decode()) | ||
obj = {'id': jobid, 'R': r_obj, 'final': True} | ||
pprint(obj) | ||
flux.Flux().rpc('sched.free', obj) | ||
sys.exit(0) | ||
EOF | ||
|
||
cat <<'EOF' >incomplete-free.py | ||
import flux | ||
import json | ||
import sys | ||
import subprocess as sp | ||
from pprint import pprint | ||
jobid=int(sp.check_output(['flux', 'job', 'id', sys.argv[1]]).decode()) | ||
R_str = '{"version": 1, "execution": {"R_lite": [{"rank": "1", "children": {"core": "0-15", "gpu": "0-3"}}], "nodelist": ["node1"]}}' | ||
r_obj = json.loads(R_str) | ||
obj = {'id': jobid, 'R': r_obj, 'final': True} | ||
pprint(obj) | ||
flux.Flux().rpc('sched.free', obj) | ||
sys.exit(0) | ||
EOF | ||
|
||
cat <<'EOF' >R | ||
{"version": 1, "execution": {"R_lite": [{"rank": "0-1", "children": {"core": "0-15", "gpu": "0-3"}}], "nodelist": ["node0", "node1"]}} | ||
EOF | ||
|
||
log "Unloading modules..." | ||
flux module remove sched-simple | ||
flux module remove resource | ||
|
||
flux config load <<EOF | ||
[sched-fluxion-qmanager] | ||
queue-policy = "easy" | ||
[sched-fluxion-resource] | ||
match-policy = "lonodex" | ||
match-format = "rv1_nosched" | ||
[resource] | ||
noverify = true | ||
norestrict = true | ||
path = "R" | ||
EOF | ||
|
||
|
||
flux module load resource monitor-force-up | ||
flux module load sched-fluxion-resource | ||
flux module load sched-fluxion-qmanager | ||
flux queue start --all --quiet | ||
flux resource list | ||
flux resource status | ||
flux module list | ||
|
||
log "Running test job 1." | ||
job1=$(flux submit -N2 -t 1h --setattr=exec.test.run_duration=30s sleep inf) | ||
jobid1=$(flux job id ${job1}) | ||
log "Sending final RPC for job 1." | ||
flux python ./free.py ${jobid1} | ||
|
||
log "Running test job 2." | ||
job2=$(flux submit -N2 -t 1h --setattr=exec.test.run_duration=30s sleep inf) | ||
jobid2=$(flux job id ${job2}) | ||
log "Sending final RPC for job 1." | ||
flux python ./incomplete-free.py ${jobid2} | ||
|
||
flux jobs -a | ||
|
||
log "reloading sched-simple..." | ||
flux module remove sched-fluxion-qmanager | ||
flux module remove sched-fluxion-resource | ||
flux module load sched-simple | ||
|