[wpt-sync] Sync PR 20187 - [testharness.js] Implement `promise_setup`
Categories
(Testing :: web-platform-tests, task, P4)
Tracking
(firefox72 fixed)
Tracking | Status | |
---|---|---|
firefox72 | --- | fixed |
People
(Reporter: mozilla.org, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 20187 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/20187
Details from upstream follow.
Mike Pennisi <mike@mikepennisi.com> wrote:
[testharness.js] Implement
promise_setup
This enacts the change specified by WPT RFC 32
https://github.com/web-platform-tests/rfcs/blob/master/rfcs/asynchronous_setup.md
This implementation differs from the algorithm in WPT RFC 32 in one regard: the operations are deferred until the completion of any subtests which were previously defined using
promise_test
. Take the following test for example:promise_test(async () => {}), 'a'); promise_setup(async () => {}); promise_test(async () => {}), 'b');
As written in the RFC, the subtest named "a" and the setup code would run in parallel. The subtest named "b" would run following the completion of both.
In the implementation proposed here, the setup code does not run until after the subtest named "a" has completed. The subtest named "b" runs after the setup code has completed. The application of any optional setup properties is likewise deferred, so in keeping with the existing behavior of
setup
, they are ignored.My cursory search through recent test results didn't turn up any occurrences of this pattern (i.e. setup after some tests are defined), but it's hard to make a conclusive inquiry because asynchronous setup is currently accomplished in an ad-hoc way. My motivation for this divergence is more about consistency and predictability than it is about supporting existing tests.
If we agree that this is in-line with the spirit of the RFC, then I can amend the RFC accordingly. If folks feel this is too substantial a change to make in a code review, I can file a new RFC to propose the alteration.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
PR 20187 applied with additional changes from upstream: 6d57097946b96d8d36dca2ef54984b45189f19c7, f15a13debaee6ea34ae2a0a44a202e56bd1bf9af, cbeb6f7c0d963489ec456e48ee544d17cfd7efba, 84fdc889f2acf313de363722a469a13a2924f361, 17543bc30bdf65838e9ec8e3b3b6fd210dced66e, acd5eb03c5e4b8c8aa1c30a1697101be2ea7f2d3, 5d71a0085efb9464d714dea6198db6273bc31b1c
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
Pushed to try https://treeherder.mozilla.org/#/jobs?repo=try&revision=85aedc7c0163d6829da36d3439d4058021a0126e
Assignee | ||
Comment 3•3 years ago
|
||
The PR was not expected to affect any tests, but the try push wasn't a success. Check the try results for infrastructure issues
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ea4b8bc6a37a [wpt PR 20187] - [testharness.js] Implement `promise_setup`, a=testonly
Assignee | ||
Comment 5•3 years ago
|
||
Test result changes from PR not available.
Comment 6•3 years ago
|
||
bugherder |
Description
•