Skip to content

Commit 789ff02

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
[test] Clean timeout on completion
If the test are fast in theory the next set up can be started and fail in the middle of waiting. Bug: none Change-Id: I642c5c8894651140bce53e949fbb8240b100a7ff Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6252781 Reviewed-by: Danil Somsikov <[email protected]> Commit-Queue: Nikolay Vitkov <[email protected]>
1 parent 3cd5631 commit 789ff02

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

front_end/ui/visual_logging/Debugging.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,8 @@ export async function expectVeEvents(expectedEvents: TestLogEntry[]): Promise<vo
674674
const {promise, resolve: success, reject: fail} = Promise.withResolvers<void>();
675675
pendingEventExpectation = {expectedEvents, success, fail};
676676
checkPendingEventExpectation();
677-
setTimeout(() => {
677+
678+
const timeout = setTimeout(() => {
678679
if (pendingEventExpectation?.missingEvents) {
679680
pendingEventExpectation.fail(new Error(
680681
'Missing VE Events: ' +
@@ -683,7 +684,10 @@ export async function expectVeEvents(expectedEvents: TestLogEntry[]): Promise<vo
683684
.join('\n')));
684685
}
685686
}, EVENT_EXPECTATION_TIMEOUT);
686-
return promise;
687+
688+
return promise.finally(() => {
689+
clearTimeout(timeout);
690+
});
687691
}
688692

689693
let numMatchedEvents = 0;

0 commit comments

Comments
 (0)