diff options
| author | Mark Johnston <markj@FreeBSD.org> | 2026-01-22 15:50:25 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2026-01-22 15:50:25 +0000 |
| commit | 560c22937ba96e8bab57de395dcf340ecf8d6794 (patch) | |
| tree | ae2bb94a85296cd80d079599e28c5b406f6a2582 /source/Plugins/LanguageRuntime/Java/JavaLanguageRuntime.cpp | |
| parent | ffdbc1bc2170226547fcad036f01f379625886dd (diff) | |
syslogd/tests: Address races
I occasionally see failures in the syslogd test suite. The problem is
that the tests are racy: they send a message using logger(1), then
immediately check whether the message was logged to a log file. If the
syslogd instance under test doesn't get a chance to run before the
second step, the test fails.
This change reworks things to avoid the race while minimizing the amount
of time sleeping.
1) Each test uses a single logfile, so have them use a new common
variable, SYSLOGD_LOGFILE, instead of something test-specific.
2) In syslogd_start(), if the configuration references SYSLOGD_LOGFILE,
wait for it to be created by syslogd before returning.
3) Add a helper syslogd_check_log(), to check for a given log entry in
the last line of SYSLOGD_LOGFILE, instead of using atf_check
directly.
4) In syslogd_check_log(), poll the logfile until the desired log entry
appears, or the test times out.
With this change, I was able to run the tests 1000 times in a loop with
4-way parallelism without seeing any test failures. Without the change
I usually get a failure within 10 loops.
Reviewed by: jlduran
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54779
Diffstat (limited to 'source/Plugins/LanguageRuntime/Java/JavaLanguageRuntime.cpp')
0 files changed, 0 insertions, 0 deletions
