-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wptrunner] Lazily post testdriver result while polling the next mess…
…age (#49513) * [wptrunner] Introduce `WebDriverTestDriverProtocolPart.get_next_message` ... for symmetry with `send_message()`, which the executor uses to settle async testdriver calls browser-side. This is a no-op refactor that gives vendors more flexibility how to exchange messages with the test page. * [wptrunner] Lazily post testdriver result while polling the next message Currently, a typical testdriver call takes three WebDriver commands: 1. Poll the next browser -> executor message via the resume script 2. Execute the requested testdriver command (e.g., "element click" for `test_driver.click()`) 3. Post the result of (2) from executor -> browser, which resolves the call's promise The testharness executor repeats the above steps in an event loop until a message from (1) indicates the test is complete (or a helper thread times out the loop). This PR optimizes the speed of testdriver-heavy tests by combining (3) and (1) for pairs of consecutive calls by running them in the same "execute async script" invocation [a]. This PR should be entirely transparent to tests because the browser should eventually see all `send_message()` calls in the same order, with no changes in testdriver semantics. When tested downstream, no tests regress [b], and the following local test sees a modest speedup from 16 to 15.5 min: ```sh run_headless_shell_wpt external/wpt/editing/other/join-different-white-space-style-paragraphs.html -vv -j 1 ``` [a]: https://w3c.github.io/webdriver/#execute-async-script [b]: https://chromium-review.googlesource.com/c/chromium/src/+/6068186/1?tab=checks See Also: https://crbug.com/381927516
- Loading branch information
1 parent
19ed6d1
commit 3684d7f
Showing
2 changed files
with
98 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters