DevTools: Fix flaky worker-autoattach-order test
There are several ways this test can flake the way it's written. Use a handler for AttachedToTarget instead of onceAttachedToTarget to avoid the ordering problems there. Use evaluateAsync to actually wait for the Promise.all call to resolve. We also can't make any assumption about the resolved status of setAutoAttach except that it is resolved after the two attached events are fired - which is what we are trying to test. So just rely on the ordering of the output to prove that it is resolved after the two events arrive. Drive-by fix to two other tests which used onceAttachedToTarget too late and could flake if the event fires after evaluate() but before the event handler is added. Fixed: 915472 Change-Id: Id4a20488273a0b1a963e732c14e38b5efcd094ba Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1943170Reviewed-by:Mathias Bynens <mathias@chromium.org> Commit-Queue: Peter Marshall <petermarshall@chromium.org> Cr-Commit-Position: refs/heads/master@{#720156}
Showing
Please register or sign in to comment