tests: Give more leeway in rx/event-t

Currently, the rx/event-t tests schedule a bunch of events up to 3
seconds in the future, and then we sleep for 3 seconds to give them a
chance to run. Since we're cutting it so close, this can rarely result
in a few events not being run (observed occasionally on FreeBSD 12.1,
where we failed to run about 3 events out of 10000).

To avoid this, just sleep for 4 seconds instead of 3. Also print out a
little more info regarding the number of fired/cancelled events, so we
can see the event count when it's wrong.

Change-Id: I6269bea2c245aeed00c129ff638423d0fa81ad23
Reviewed-on: https://gerrit.openafs.org/14160
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
Andrew Deason 2020-04-25 18:21:10 -05:00 committed by Benjamin Kaduk
parent 2b4908d3be
commit ebaefc5a06

View File

@ -179,7 +179,7 @@ main(void)
ok(1, "Added %d events", NUMEVENTS);
sleep(3);
sleep(4);
fired = 0;
cancelled = 0;
@ -193,7 +193,9 @@ main(void)
fail = 1;
}
ok(!fail, "Didn't fire any cancelled events");
ok(fired+cancelled == NUMEVENTS,
diag("fired %d/%d events", fired, NUMEVENTS);
diag("cancelled %d/%d events", cancelled, NUMEVENTS);
is_int(NUMEVENTS, fired+cancelled,
"Number of fired and cancelled events sum to correct total");
return 0;