mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1071920 - Make sure we don't time out incorrectly with chaos mode (r=roc)
This commit is contained in:
parent
00611e8e68
commit
9a60c4ff8c
@ -676,7 +676,18 @@ Tester.prototype = {
|
||||
}
|
||||
else {
|
||||
var self = this;
|
||||
var timeoutExpires = Date.now() + gTimeoutSeconds * 1000;
|
||||
var waitUntilAtLeast = timeoutExpires - 1000;
|
||||
this.currentTest.scope.__waitTimer = setTimeout(function timeoutFn() {
|
||||
// We sometimes get woken up long before the gTimeoutSeconds
|
||||
// have elapsed (when running in chaos mode for example). This
|
||||
// code ensures that we don't wrongly time out in that case.
|
||||
if (Date.now() < waitUntilAtLeast) {
|
||||
self.currentTest.scope.__waitTimer =
|
||||
setTimeout(timeoutFn, timeoutExpires - Date.now());
|
||||
return;
|
||||
}
|
||||
|
||||
if (--self.currentTest.scope.__timeoutFactor > 0) {
|
||||
// We were asked to wait a bit longer.
|
||||
self.currentTest.scope.info(
|
||||
|
Loading…
Reference in New Issue
Block a user