Skip to content

Commit 9701f74

Browse files
authored
Increase WebDriver timeouts to address integration test flakiness (#9475)
1 parent cd14e27 commit 9701f74

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

packages/devtools_app/test_driver/integration_test.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,23 @@ const _goldensDirectoryPath = 'integration_test/test_infra/goldens';
1616
const _failuresDirectoryPath = '$_goldensDirectoryPath/failures';
1717
const _defaultDiffPercentage = 1.0;
1818
const _defaultDiffTolerance = 0.003;
19+
// The following timeouts were copied from
20+
// https://developer.mozilla.org/en-US/docs/Web/WebDriver/Reference/Timeouts
21+
const _defaultWebDriverPageLoadTimeoutInMins = 5;
22+
const _defaultWebDriverScriptTimeoutInSeconds = 30;
1923

2024
Future<void> main() async {
2125
final driver = await FlutterDriver.connect();
26+
27+
// Double the WebDriver timeout limits to handle test flakiness.
28+
// See https://github.com/flutter/devtools/issues/9474
29+
await driver.webDriver.timeouts.setScriptTimeout(
30+
const Duration(seconds: _defaultWebDriverScriptTimeoutInSeconds * 2),
31+
);
32+
await driver.webDriver.timeouts.setPageLoadTimeout(
33+
const Duration(minutes: _defaultWebDriverPageLoadTimeoutInMins * 2),
34+
);
35+
2236
await integrationDriver(
2337
driver: driver,
2438
onScreenshot:

0 commit comments

Comments
 (0)