forked from flux-framework/flux-core
-
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.
Merge pull request flux-framework#4738 from chu11/issue4711_job_list_…
…purge_inactive job-list: ensure purged jobs are inactive
- Loading branch information
Showing
3 changed files
with
29 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
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,26 @@ | ||
#!/bin/bash -e | ||
|
||
# test-prereqs: HAVE_JQ | ||
|
||
prejob=$(flux job stats | jq .job_states.run) | ||
|
||
jobid=$(flux mini submit --wait-event=start sleep 100 | flux job id) | ||
|
||
postjob=$(flux job stats | jq .job_states.run) | ||
|
||
if [ ${postjob} -ne $((prejob + 1)) ] | ||
then | ||
echo "stat counts invalid: ${postjob}, ${prejob}" | ||
exit 1 | ||
fi | ||
|
||
flux event pub job-purge-inactive "{\"jobs\":[${jobid}]}" | ||
|
||
# if job-list module asserted this won't work | ||
|
||
# this is technically a bit racy, as we won't know for sure if the | ||
# event has been received / processed by the job-list module yet. In | ||
# the rare event the racy bit is hit and our fix regresses, subsequent | ||
# flux actions should catch a failure. | ||
|
||
flux job stats |