Timed out waiting for asyncrhonous script

I’m getting strange timeouts when using appium. Looks like this:

[debug] e[35m[RemoteDebugger]e[39m Received data response from send (id: 182): '"{\"status\":28,\"value\":{\"message\":\"Timed out waiting for asyncrhonous script result after 6 ms\"}}"'

Timeout value is very different and seems like random value in range from 5ms to 30ms.
Full log https://gist.github.com/rostik404/9447b0b88438414ad2e35c05e33fd84d

Seems like error comes from here, but according to the code, timeout should be 1000ms

Any ideas, how can I increase this timeout?
appium version is 1.22.2, but also I reprodused this on 1.22.0 and 1.21.0.

Code you reference is looking for an alert. It’s not finding one.

Any solution here would be a guess because we can’t see your test code. I’m not even sure what language you are using, possibly javascript? If you choose to share the code, please include capabilities.

Yes, I’m using javascript and webdriver.io to automate test cases.
The problem was in executeAsync method http://v4.webdriver.io/api/protocol/executeAsync.html - it has flaky timeout by default (I don’t know how it’s possible), so after adding this line this.browser.timeoutsAsyncScript(5000) problem is not reproducing.

1 Like

Thanks for posting the solution. Hopefully it will help someone else.

1 Like