Page MenuHomeFreeBSD

uniq tests: Make uniq_test:stdout more reliable
ClosedPublic

Authored by markj on Fri, Jun 7, 7:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jul 1, 4:57 PM
Unknown Object (File)
Mon, Jul 1, 10:59 AM
Unknown Object (File)
Mon, Jul 1, 8:17 AM
Unknown Object (File)
Mon, Jul 1, 3:59 AM
Unknown Object (File)
Mon, Jun 24, 1:50 PM
Unknown Object (File)
Sun, Jun 23, 11:15 AM
Unknown Object (File)
Fri, Jun 14, 1:21 AM
Unknown Object (File)
Wed, Jun 12, 3:12 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.Fri, Jun 7, 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.Mon, Jun 10, 3:39 PM