mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 00:02:14 -04:00
tests/kqueue: repair flaky test
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 495 msec.
The problem started to show up recently, and I attribute that to
626ea75ed2. Before this revision sleep(3) was almost always sleeping
over 1000 msec, now it can sleep exactly 1000 msec.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D50996
This commit is contained in:
parent
d17cbe4698
commit
994bec47ee
1 changed files with 1 additions and 1 deletions
|
|
@ -199,7 +199,7 @@ test_periodic_modify(void)
|
|||
kevent_cmp(&kev, kevent_get(kqfd));
|
||||
|
||||
/* Check if the event occurs again */
|
||||
EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, 0, 500, NULL);
|
||||
EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, 0, 495, NULL);
|
||||
if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0)
|
||||
err(1, "%s", test_id);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue