Repository navigation
Wait for clamd's finish script before restarting it in the reload test - #101
Merged
Merged
Conversation
The "cron user's reload waits for clamd to start" test stopped clamd and sent s6-svc -u as soon as the clamd process was gone. On exit code 0, clamd's finish script sends its own s6-svc -d, and that runs after the process exits. When the test's -u landed before it, clamd stayed down, the reload's ping timed out, and the test failed with "Could not connect to clamd". s6-svc -wD -d returns only once the finish script has exited.
SaraSmiseth
approved these changes
Nov 14, 2026
ksylvan
approved these changes
Nov 14, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Note
TLDR: another small fix for race in tests that sometimes makes tests fail for no good reason.
What is the current behavior (you can also link to an open issue here) ?
The test restarts clamd before running the reload:
setup.shgives every service afinishscript that runss6-svc -dwhen the service exits with code 0, so that a service stopped on purpose stays down. That script runs after the clamd process has exited, so the loop above can finish before it does. When the test's-ulands first, the finish script's-dwins and clamd stays down. The reload's ping (clamdscan --ping 300:1) then gives up after 300 seconds and the test fails.It is rare: one failure in a day of local suite runs, and none in 21 loops of the exact sequence. In those loops the finish script logged 32 to 196 ms before the test's
-u. The failed run ended with clamddown (exitcode 0)and the finish script'sstopping clamd processin the log.The image itself does not hit this. It brings clamd up from freshclam's run script and reloads it with SIGUSR2; nothing in it stops clamd and starts it again.
What is the new behavior (if this is a feature change) ?
s6-svc -wD -d /services/clamd; s6-svc -u /services/clamd-wDreturns only once the service is down and its finish script has exited, so the-ucan no longer be undone. The image's own.s6-svscan/finishwaits the same way. No other test stops and restarts a service.Type of change
Status
Todo List
How has this been tested ?
-d, the old sequence left clamd down 3 times out of 3, the same end state as the failed run. With the same delay in place, the new sequence brought clamd up 3 times out of 3.defaultsuite passed 136/136 with this change, on9d2d46a. The branch has since been rebased ontobd09d3b, which only touches the workflows; the change itself is identical.