Skip to content

Commit 5d7390c

Browse files
committed
Add some retry?!?
1 parent 7eed2c4 commit 5d7390c

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

dwds/test/fixtures/context.dart

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -433,17 +433,30 @@ class TestContext {
433433
' -> notice chrome driver identity hash code is '
434434
'${identityHashCode(_chromeDriver)}',
435435
);
436-
log('Also notice Platform.environment:');
437-
for (final entry in Platform.environment.entries) {
438-
log(' ${entry.key}: ${entry.value}');
436+
try {
437+
_webDriver = await createDriver(
438+
spec: WebDriverSpec.JsonWire,
439+
desired: capabilities,
440+
uri: Uri.parse(
441+
'http://127.0.0.1:$chromeDriverPort/$chromeDriverUrlBase/',
442+
),
443+
);
444+
} on SocketException catch (e) {
445+
log('Got "$e". Will wait a bit and try again.');
446+
await Future.delayed(const Duration(seconds: 2));
447+
try {
448+
_webDriver = await createDriver(
449+
spec: WebDriverSpec.JsonWire,
450+
desired: capabilities,
451+
uri: Uri.parse(
452+
'http://127.0.0.1:$chromeDriverPort/$chromeDriverUrlBase/',
453+
),
454+
);
455+
} on SocketException catch (e) {
456+
log('Got exception again: "$e"');
457+
rethrow;
458+
}
439459
}
440-
_webDriver = await createDriver(
441-
spec: WebDriverSpec.JsonWire,
442-
desired: capabilities,
443-
uri: Uri.parse(
444-
'http://127.0.0.1:$chromeDriverPort/$chromeDriverUrlBase/',
445-
),
446-
);
447460
}
448461

449462
// The debugger tab must be enabled and connected before certain

0 commit comments

Comments
 (0)