Open tristanlabelle opened 1 year ago
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.")
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.