chore: give more time to polling matchers to print friendly error (#26595)

This commit is contained in:
Pavel Feldman 2023-08-22 09:01:42 -07:00 committed by GitHub
parent cd07401d20
commit afc5ebe075
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,7 +110,7 @@ export class TestInfoImpl implements TestInfo {
_deadlineForMatcher(timeout: number): { deadline: number, timeoutMessage: string } { _deadlineForMatcher(timeout: number): { deadline: number, timeoutMessage: string } {
const startTime = monotonicTime(); const startTime = monotonicTime();
const matcherDeadline = timeout ? startTime + timeout : MaxTime; const matcherDeadline = timeout ? startTime + timeout : MaxTime;
const testDeadline = this._timeoutManager.currentSlotDeadline() - 100; const testDeadline = this._timeoutManager.currentSlotDeadline() - 250;
const matcherMessage = `Timeout ${timeout}ms exceeded while waiting on the predicate`; const matcherMessage = `Timeout ${timeout}ms exceeded while waiting on the predicate`;
const testMessage = `Test timeout of ${this.timeout}ms exceeded`; const testMessage = `Test timeout of ${this.timeout}ms exceeded`;
return { deadline: Math.min(testDeadline, matcherDeadline), timeoutMessage: testDeadline < matcherDeadline ? testMessage : matcherMessage }; return { deadline: Math.min(testDeadline, matcherDeadline), timeoutMessage: testDeadline < matcherDeadline ? testMessage : matcherMessage };