Repository navigation
Run one Chrome driver session before the Selenium contract tests - #138
Merged
Merged
Conversation
Starting Chrome directly left the first contract test on the Intel macOS runners 17 to 34 seconds against 3 to 5 for its other runs. The script now also starts the driver, opens a headless session as the first test does, loads a blank page and ends the session, timing each part, so that the rest of the first start falls outside the tests' limits too.
jwrosewell
marked this pull request as ready for review
November 14, 2026 15:51
This was referenced Nov 14, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #126.
Problem
The Selenium contract tests timed out on the Intel macOS runners when the first test of the run,
ExampleClientSideOverridePageContentTests.Example_RendersClientSideOverridesOnThePage, waited longer than Selenium's 60 second command limit inGoToUrl. #124 starts Chrome once, directly, before the tests, which takes the first start of Chrome (156.1 to 162.2 seconds on those runners in its build) outside the tests. Even so, in full build 43442211049 the first test still took 17, 23 and 34 seconds on the three Intel macOS runners, against 3 to 5 seconds for the same test's other runs, as #126 sets out. Part of the first cost came with the first session through the Chrome driver, which a direct start of Chrome does not make.What changed and why
ci/start-chrome-once.ps1(a232305f), which the contract tests' step inci/run-integration-tests.ps1runs first, now also runs one session through the Chrome driver after starting Chrome directly, as the first contract test does.CHROMEWEBDRIVER, then the path) on a free port on the loopback address and waits until its/statussays it is ready.--headlessandacceptInsecureCerts, and names the browser only when the tests would (CHROME_BIN, then a browser on the path), asBrowserDrivers.CreateChromeat e8605df3 and the test's options do.about:blank, ends the session and stops the driver, and prints how long each part took.Each command has the script's existing limit of 300 seconds. A part that fails is a warning and the tests then run as they would have without it, and the driver and the browser profile are removed whatever happens, as for the direct start. It is a CI script only, so it changes no package and releases nothing.
How it was measured
A throwaway run, 43588616992 on
tmp/java-chrome-session, ran the script twice on each of the four images CI uses for Chrome. The first session through the driver took 19.1 seconds to start onmacos-15-intel, after Chrome's direct first start of 171.8 seconds, and 1.9 seconds the second time. It took 3.9 seconds onmacos-15, 2 seconds on Windows and 0.2 seconds on Ubuntu, with no warning on any.Full build
Run 43590236784 built a232305 merged with
rc(1c99b72) on all fifteen configurations, macOS included, as #126 asks for a build with macOS, and every job passed, Compare Performance included. Each of its sixteenSetting 'PullRequestSha'lines names a232305, and its Configure job left nothing out.The first contract test now takes what its other runs take. Each row is that test's four runs on one runner, in the order they finished, the first being the first test of the run.
On the Intel macOS runners the first test took 3, 6 and 4 seconds against 3 seconds for the runs after it, where #124's build measured 17, 23 and 34 seconds, so the first session through the driver, which now takes 14.3 to 26.3 seconds before the tests, was the cost left.
What remains
MacOS_Java_17the direct start of Chrome, which Start Chrome once before the Selenium contract tests #124 added, did not finish within 300 seconds and was stopped with its warning. The driver session after it started in 3.3 seconds and the tests passed, but the job spent five minutes waiting. It happened once in this build's six macOS jobs, and Start Chrome once before the Selenium contract tests #124's build saw no stop. If it recurs, the direct start could be dropped in favour of the driver session alone, which then makes Chrome's first start itself.