-
Notifications
You must be signed in to change notification settings - Fork 35
Fix SIGPIPE-related failures in testsuite #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,40 @@ export SPINDLE_TEST=1 | |
| export SPINDLE=SPINDLE_EXEC | ||
| export PATH=$PATH:. | ||
|
|
||
| SESSION_ACTIVE=false | ||
| if [ "x$SESSION_ID" != "x" ] || [ "x$SPANK_SPINDLE_USE_SESSION" != "x" ] ; then | ||
| SESSION_ACTIVE=true | ||
| fi | ||
|
|
||
| # If we're not running in a session, wait, on every node in the job, for | ||
| # the log daemon to exit before proceeding to the actual test; after a | ||
| # delay, forcibly kill it. This ensures that each test connects to a | ||
| # fresh daemon. | ||
| if [ $SESSION_ACTIVE == false ] && [ "x$1" != "x--end-session" ] ; then | ||
| # This is the command run on each node. | ||
| LOGD_WAIT_CMD=' | ||
| SECONDS=0 | ||
| TMP="${TMPDIR:-${TEMPDIR:-/tmp}}" | ||
| LOCK="$TMP/spindle_log_lock" | ||
| TIMEOUT="${SPINDLE_LOGD_SHUTDOWN_TIMEOUT:-15}" | ||
| while PID=$(cat "$LOCK" 2>/dev/null) && kill -0 "$PID" 2>/dev/null ; do | ||
| if [ $SECONDS -ge $TIMEOUT ]; then | ||
| echo "WARNING: $(hostname): spindle_logd (pid $PID) still running after $TIMEOUT sec; killing it" >&2 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm testing serially, and getting this warning with every test run: From glancing at the code, I think this will trigger with every test suite run. Suggest cleaning up the warning prints, or clean up the way the test runs so it doesn't go down this error path.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed the test, so this warning no longer occurs on every run. |
||
| kill -9 "$PID" 2>/dev/null | ||
| break | ||
| fi | ||
| sleep 0.1 | ||
| done | ||
| rm -f "$TMP/spindle_log" "$TMP/spindle_test" "$TMP/spindle_log_lock" "$TMP/spindle_log_reset" | ||
| ' | ||
| bash -c "$LOGD_WAIT_CMD" | ||
| if [ "x$TEST_RM" == "xslurm" -o "x$TEST_RM" == "xslurm-plugin" ] && [ "x$SLURM_NNODES" != "x" ] ; then | ||
| srun --overlap -N $SLURM_NNODES -n $SLURM_NNODES bash -c "$LOGD_WAIT_CMD" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR didn't introduce TEST_RM to the test scripts, but the expanded usage here is revealing the weaknesses around our system for selecting what RM to use in tests. It used to be that TEST_RM was a only build-time flag that just determined which test_driver_${TEST_RM} file got copied to test_driver_rm installation location. And we could switch RMs (I'd usually switch between serial and the system RM) by manually copying a different file to the installation location. Now we have to switch RMs with two steps that have to agree: Update TEST_RM in runTests and copy the desired file. Let's fix this in another PR. But let's get back to needing to change only one thing to switch RMs. My suggestion is to:
I'll put this into a new issue. No need to do anything about this in this PR. |
||
| elif [ "x$TEST_RM" == "xflux" ] ; then | ||
| flux exec -r all bash -c "$LOGD_WAIT_CMD" | ||
| fi | ||
| fi | ||
|
|
||
| if [ $1 == --start-session ] ; then | ||
| # With SPANK plugin, sessions are started by argument to salloc/sbatch instead | ||
| if [ "x$TEST_RM" == "xslurm-plugin" ] ; then | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm waiting in a queue to test, so I haven't verified this. But I think this code will break debug logging for spindle session tests. We used to get the debug logs integrated for all session tests (which is probably how you want to debug session problems), and this will break that into multiple logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we kill the log daemon only when we're not in a session?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Though since writing the above comment I got a node to test with, and it's not doing that....
And now I see more clearly that I'd mis-read the quoting on LOGD_WAIT_CMD='...'. And all of that LOGD_WAIT_CMD code will only run if the "if [ $SESSION_ACTIVE == false ] && [ "x$1" != "x--end-session" ] ;" condition triggers. So that's all correct.
I will say that it's a little easy to mis-read and think that LOGD_WAIT_CMD contents will run with every invocation of run_driver. What about moving the setting of the LOGD_WAIT_CMD variable to inside the wait_for_logd_exit() function? Just to make it a bit clearer at a glance when that code runs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. Yes, I'll move it into the function. It's stored in a variable to begin with because we pass it to
bash -cinvocations on the compute nodes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this to the place where it is used. With the removal of the
logd_kill_testtest, there was only one place wherewait_for_logd_exitwas called, so it's no longer a separate function, and is instead directly in the body of the if that checks whether a session is used