Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web-locks/signal.tentative.https.any.serviceworker.html is flaky #15015

Open
foolip opened this issue Jan 23, 2019 · 1 comment
Open

web-locks/signal.tentative.https.any.serviceworker.html is flaky #15015

foolip opened this issue Jan 23, 2019 · 1 comment

Comments

@foolip
Copy link
Member

foolip commented Jan 23, 2019

#14420 revealed that web-locks/signal.tentative.https.any.serviceworker.html is flaky. This can be seen by running ./wpt run --verify --channel dev --binary which google-chrome-unstable --log-tbpl - chrome /web-locks/signal.tentative.https.any.serviceworker.html locally, producing this table:

Subtest Results Messages
OK
The signal option must be an AbortSignal PASS
Passing an already aborted signal aborts PASS
An aborted request results in AbortError FAIL: 5/10, PASS: 5/10 assert_equals: expected 1 but got 2
Abort after a timeout FAIL: 4/10, PASS: 6/10 assert_equals: expected 1 but got 2
Signal that is not aborted PASS
Synchronously signaled abort PASS
Abort signaled after lock granted PASS
Abort signaled after lock released PASS

These are the flaky subtests:

promise_test(async t => {
const res = uniqueName(t);
// Grab a lock and hold it forever.
const never_settled = new Promise(resolve => { /* never */ });
navigator.locks.request(res, lock => never_settled);
const controller = new AbortController();
const promise =
navigator.locks.request(res, {signal: controller.signal},
t.unreached_func('callback should not run'));
// Verify the request is enqueued:
const state = await navigator.locks.query();
assert_equals(state.held.filter(lock => lock.name === res).length, 1);
assert_equals(state.pending.filter(lock => lock.name === res).length, 1);
const rejected = promise_rejects(
t, 'AbortError', promise, 'Request should reject with AbortError');
controller.abort();
await rejected;
}, 'An aborted request results in AbortError');

promise_test(async t => {
const res = uniqueName(t);
// Grab a lock and hold it forever.
const never_settled = new Promise(resolve => { /* never */ });
navigator.locks.request(res, lock => never_settled);
const controller = new AbortController();
const promise =
navigator.locks.request(res, {signal: controller.signal}, lock => {});
// Verify the request is enqueued:
const state = await navigator.locks.query();
assert_equals(state.held.filter(lock => lock.name === res).length, 1);
assert_equals(state.pending.filter(lock => lock.name === res).length, 1);
const rejected = promise_rejects(
t, 'AbortError', promise, 'Request should reject with AbortError');
let callback_called = false;
t.step_timeout(() => {
callback_called = true;
controller.abort();
}, 10);
await rejected;
assert_true(callback_called, 'timeout should have caused the abort');
}, 'Abort after a timeout');

The test came from #12449 / #12860 by @inexorabletash and reviewed by @pwnall.

@foolip
Copy link
Member Author

foolip commented Jan 23, 2019

With #15016 applied one can tell that it is the second assert_equals in each subtest that fails, the one for state.pending.filter(lock => lock.name === res).length.

That it's so consistently 5/10 failing and a length 2 instead of 1 suggests that this isn't the random variety of flakiness, but an interaction or state dependency that consistently happens if the tests are run in this way.

By guess is that the uniqueName helped isn't producing globally unique names and that two instances of the test are running in the same browser at the same time. That would at least produce something like this failure.

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Feb 5, 2019
…t to aid debugging, a=testonly

Automatic update from web-platform-tests
Add assert descriptions to Web Locks test to aid debugging (#15016)

For web-platform-tests/wpt#15015.
--

wpt-commits: 4ac3172e8d86ade4a9ded497bd10a1124fc6e231
wpt-pr: 15016
mykmelez pushed a commit to mykmelez/gecko that referenced this issue Feb 6, 2019
…t to aid debugging, a=testonly

Automatic update from web-platform-tests
Add assert descriptions to Web Locks test to aid debugging (#15016)

For web-platform-tests/wpt#15015.
--

wpt-commits: 4ac3172e8d86ade4a9ded497bd10a1124fc6e231
wpt-pr: 15016
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Feb 7, 2019
…t to aid debugging, a=testonly

Automatic update from web-platform-tests
Add assert descriptions to Web Locks test to aid debugging (#15016)

For web-platform-tests/wpt#15015.
--

wpt-commits: 4ac3172e8d86ade4a9ded497bd10a1124fc6e231
wpt-pr: 15016
mykmelez pushed a commit to mykmelez/gecko that referenced this issue Feb 8, 2019
…t to aid debugging, a=testonly

Automatic update from web-platform-tests
Add assert descriptions to Web Locks test to aid debugging (#15016)

For web-platform-tests/wpt#15015.
--

wpt-commits: 4ac3172e8d86ade4a9ded497bd10a1124fc6e231
wpt-pr: 15016
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
…t to aid debugging, a=testonly

Automatic update from web-platform-tests
Add assert descriptions to Web Locks test to aid debugging (#15016)

For web-platform-tests/wpt#15015.
--

wpt-commits: 4ac3172e8d86ade4a9ded497bd10a1124fc6e231
wpt-pr: 15016

UltraBlame original commit: d6f60b92b7532559e81938730896ed4e1c266534
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
…t to aid debugging, a=testonly

Automatic update from web-platform-tests
Add assert descriptions to Web Locks test to aid debugging (#15016)

For web-platform-tests/wpt#15015.
--

wpt-commits: 4ac3172e8d86ade4a9ded497bd10a1124fc6e231
wpt-pr: 15016

UltraBlame original commit: e277ba0e12c4903174a5014d0c5ed4ecc6607008
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
…t to aid debugging, a=testonly

Automatic update from web-platform-tests
Add assert descriptions to Web Locks test to aid debugging (#15016)

For web-platform-tests/wpt#15015.
--

wpt-commits: 4ac3172e8d86ade4a9ded497bd10a1124fc6e231
wpt-pr: 15016

UltraBlame original commit: d6f60b92b7532559e81938730896ed4e1c266534
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
…t to aid debugging, a=testonly

Automatic update from web-platform-tests
Add assert descriptions to Web Locks test to aid debugging (#15016)

For web-platform-tests/wpt#15015.
--

wpt-commits: 4ac3172e8d86ade4a9ded497bd10a1124fc6e231
wpt-pr: 15016

UltraBlame original commit: e277ba0e12c4903174a5014d0c5ed4ecc6607008
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 4, 2019
…t to aid debugging, a=testonly

Automatic update from web-platform-tests
Add assert descriptions to Web Locks test to aid debugging (#15016)

For web-platform-tests/wpt#15015.
--

wpt-commits: 4ac3172e8d86ade4a9ded497bd10a1124fc6e231
wpt-pr: 15016

UltraBlame original commit: d6f60b92b7532559e81938730896ed4e1c266534
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 4, 2019
…t to aid debugging, a=testonly

Automatic update from web-platform-tests
Add assert descriptions to Web Locks test to aid debugging (#15016)

For web-platform-tests/wpt#15015.
--

wpt-commits: 4ac3172e8d86ade4a9ded497bd10a1124fc6e231
wpt-pr: 15016

UltraBlame original commit: e277ba0e12c4903174a5014d0c5ed4ecc6607008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant