Skip to content

[web:tests] safaridriver intermittently fails to create a WebDriver session #163790

@yjbanov

Description

@yjbanov

Sample error:

Error: SessionNotCreatedException (500): Could not create a session: The session timed out while connecting to a Safari instance.
#0      parseW3cResponse (package:webdriver/src/handler/w3c/utils.dart:81:9)
#1      W3cSessionHandler.parseCreateResponse (package:webdriver/src/handler/w3c/session.dart:19:21)
#2      InferSessionHandler.parseCreateResponse (package:webdriver/src/handler/infer_handler.dart:106:34)
#3      AsyncRequestClient.send (package:webdriver/src/common/request_client.dart:96:32)

This happens after safaridriver server starts listening to HTTP connections. In this sample log, notice how on the first attempt safaridriver failed to create a server. Then on retry 1, the server started successfully, but it failed to create a driver session. Our current approach is to abandon everything and start a brand new safaridriver instance. But that exposes us to the risk of failing to open the port again which, as you can see from all the following attempt, does indeed happen.

Proposal

Once safaridriver successfully opens a port, hold onto that server, and retry the session instead with the same safaridriver instance. It is possible 🤞 that Safari will boot up and stop timing out.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: tests"flutter test", flutter_test, or one of our testsbrowser: safari-macosonly manifests in Safari on macOSc: tech-debtTechnical debt, code quality, testing, etc.platform-macosplatform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions