Skip to content

Commit

Permalink
Extend timeout value for tests in CI
Browse files Browse the repository at this point in the history
The CI environment currently used by the project has been observed to
require between 1497ms and 10398ms to start a WebDriver session with
Firefox. Increase the upper limit to accommodate the worst-case
scenario, but do so only when the test suite is known to be running in
the continuous integration environment.
  • Loading branch information
jugglinmike committed Dec 5, 2024
1 parent 1eb6001 commit 81fd6ad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/test-macos-key-press.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ const { Builder } = require('selenium-webdriver');
const { renderScript, runScript } = require('../shared/helpers/macos/applescript');
const { KeyCodeCommandKind } = require('../shared/helpers/macos/keyCodeCommand');

// Allow for longer delays when starting the browsing session when executing
// these tests in resource-constrained continuous-integration environments.
const WEBDRIVER_SESSION_TIMEOUT = process.env.CI ? 20 * 1000 : 10 * 1000;
const documentHTML = `<!DOCTYPE html>
<html lang="en">
<body>
Expand Down Expand Up @@ -88,7 +91,7 @@ suite('macOS key press simulation', () => {
const keyTest = keyTestDriverRef.bind(null, () => driver);

suiteSetup(async function () {
this.timeout(10 * 1000);
this.timeout(WEBDRIVER_SESSION_TIMEOUT);
driver = await new Builder().forBrowser('firefox').build();
});

Expand Down

0 comments on commit 81fd6ad

Please sign in to comment.