Page MenuHomeFreeBSD

uniq tests: Make uniq_test:stdout more reliable
ClosedPublic

Authored by markj on Jun 7 2024, 7:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 7:34 PM
Unknown Object (File)
Thu, Nov 7, 6:16 AM
Unknown Object (File)
Oct 7 2024, 10:20 AM
Unknown Object (File)
Sep 20 2024, 4:34 PM
Unknown Object (File)
Sep 19 2024, 6:57 AM
Unknown Object (File)
Sep 17 2024, 7:28 PM
Unknown Object (File)
Sep 8 2024, 12:01 PM
Unknown Object (File)
Jul 11 2024, 11:14 AM
Subscribers

Details

Summary

When running regression tests in paralle, this one occasionally fails
because uniq exits with status 0. I believe this is because the test is
a bit racy: it assumes that true(1) will exit before uniq writes to
standard out.

It is easy to reproduce this failure by running the test in a loop and
running a buildkernel in the background. Make the race smaller by
sleeping for a bit. Maybe there's a cleverer way to handle this?

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Jun 7 2024, 7:33 PM
usr.bin/uniq/tests/uniq_test.sh
171

I would increase this to 1 in case the test is ever ported to a platform where sleep(1) doesn't take fractional values. It's not like anyone will notice the delay.

174

replacing true with : (which is a shell builtin, while true may or may not be) might also help.

usr.bin/uniq/tests/uniq_test.sh
174

Unfortunately, that doesn't do the trick.

Apply feedback, don't use fractional times.

This revision is now accepted and ready to land.Jun 10 2024, 3:39 PM