Page MenuHomeFreeBSD

tests/kqueue: repair flaky test
ClosedPublic

Authored by glebius on Jun 23 2025, 9:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 15, 5:35 PM
Unknown Object (File)
Sat, Oct 11, 4:42 AM
Unknown Object (File)
Sat, Oct 11, 4:42 AM
Unknown Object (File)
Sat, Oct 11, 4:42 AM
Unknown Object (File)
Fri, Oct 10, 9:34 PM
Unknown Object (File)
Wed, Oct 8, 10:46 AM
Unknown Object (File)
Mon, Oct 6, 7:53 PM
Unknown Object (File)
Sat, Sep 27, 2:28 AM
Subscribers

Details

Summary

The test arms timer for 500 msec and then sleeps 1 second and expects that
the timer would always fire exactly 2 times. However, it has a chance to
legitimately fire only once. This makes the test flaky. Fix the test
reducing sleep time down to 450 msec.

The problem started to show up recently, and I attribute that to
626ea75ed2e9. Before this revision sleep(3) was almost always sleeping
over 1000 msec, now it can sleep exactly 1000 msec.

Diff Detail

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

Event Timeline

This revision is now accepted and ready to land.Jun 24 2025, 12:40 AM
tests/sys/kqueue/libkqueue/timer.c
202

Thinking a bit more, I would probably try to avoid such a large error. Do you still see occasional test failures if the timeout is, say, 495ms?

Agreed, let's try 495 and see what CI reports after a week.

This revision was automatically updated to reflect the committed changes.