File tree Expand file tree Collapse file tree 1 file changed +23
-10
lines changed
Expand file tree Collapse file tree 1 file changed +23
-10
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments