Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout if the WebDriver HTTP endpoint is unreachable #40

Open
tristanlabelle opened this issue Jul 31, 2023 · 1 comment
Open

Timeout if the WebDriver HTTP endpoint is unreachable #40

tristanlabelle opened this issue Jul 31, 2023 · 1 comment

Comments

@tristanlabelle
Copy link
Contributor

Currently it seems like trying to send a request to a non-existing webdriver endpoint URL gets stuck forever. This is a problem now that tests require a webdriver to be started on a certain port, which can be easily forgotten.

@tristanlabelle
Copy link
Contributor Author

The below neither prints "Callback" nor "Done waiting". It crashes (ud2) somewhere in dispatch beforehand.

var request = URLRequest.init(url: URL(string: "https://127.0.0.9")!)
request.timeoutInterval = 0.1

print("\(Date()): Requesting...")
URLSession.shared.dataTask(with: request) { _, _, _ in print("Callback") }.resume()
print("\(Date()): Waiting...")
Thread.sleep(forTimeInterval: 5)
print("\(Date()): Done waiting.")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant