Increase test timeout tolerance on macOS.

This commit is contained in:
Sönke Ludwig 2019-11-02 22:52:56 +01:00
parent f23b23f360
commit c717b88057

View file

@ -26,8 +26,11 @@ void main()
assert(false, "Timeout did not occur.");
} catch (Exception e) {
auto duration = MonoTime.currTime() - start;
version (OSX) enum maxtolerance = 150.msecs;
else enum maxtolerance = 50.msecs;
assert(duration >= 99.msecs, "Timeout occurred too early");
assert(duration >= 99.msecs && duration < 150.msecs, "Timeout occurred too late.");
assert(duration >= 99.msecs && duration < 100.msecs + maxtolerance,
"Timeout occurred too late.");
logInfo("UDP receive timeout test was successful.");
exitEventLoop();
}