Relax timer test constraints and don't gag assertions.
Attempts to fix the flaky tests on macOS.
This commit is contained in:
parent
135217066f
commit
2c6b69590d
|
@ -19,13 +19,18 @@ void main()
|
||||||
|
|
||||||
auto tm = eventDriver.timers.create();
|
auto tm = eventDriver.timers.create();
|
||||||
eventDriver.timers.wait(tm, (tm) nothrow @safe {
|
eventDriver.timers.wait(tm, (tm) nothrow @safe {
|
||||||
|
Duration dur;
|
||||||
|
|
||||||
|
{
|
||||||
scope (failure) assert(false);
|
scope (failure) assert(false);
|
||||||
|
dur = Clock.currTime(UTC()) - s_startTime;
|
||||||
|
}
|
||||||
|
|
||||||
auto dur = Clock.currTime(UTC()) - s_startTime;
|
|
||||||
assert(dur > 200.msecs);
|
assert(dur > 200.msecs);
|
||||||
assert(dur < 220.msecs);
|
assert(dur < 260.msecs);
|
||||||
|
|
||||||
|
s_startTime += dur;
|
||||||
|
|
||||||
s_startTime = Clock.currTime(UTC());
|
|
||||||
eventDriver.timers.set(tm, 100.msecs, 100.msecs);
|
eventDriver.timers.set(tm, 100.msecs, 100.msecs);
|
||||||
|
|
||||||
void secondTier(TimerID timer) nothrow @safe {
|
void secondTier(TimerID timer) nothrow @safe {
|
||||||
|
|
|
@ -22,12 +22,15 @@ void main()
|
||||||
// first timer: one-shot 200ms
|
// first timer: one-shot 200ms
|
||||||
auto tm = eventDriver.timers.create();
|
auto tm = eventDriver.timers.create();
|
||||||
eventDriver.timers.wait(tm, (tm) nothrow @safe {
|
eventDriver.timers.wait(tm, (tm) nothrow @safe {
|
||||||
|
Duration dur;
|
||||||
|
{
|
||||||
scope (failure) assert(false);
|
scope (failure) assert(false);
|
||||||
writefln("First timer");
|
writefln("First timer");
|
||||||
|
dur = Clock.currTime(UTC()) - s_startTime;
|
||||||
|
}
|
||||||
|
|
||||||
auto dur = Clock.currTime(UTC()) - s_startTime;
|
assert(dur >= 200.msecs);
|
||||||
assert(dur > 200.msecs);
|
assert(dur < 250.msecs);
|
||||||
assert(dur < 220.msecs);
|
|
||||||
|
|
||||||
timer1fired = true;
|
timer1fired = true;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue