I was faced with the problem with async _queryPID function in AdroidDriver.js file.
For example, the pidof function returns a value only from the 3rd time, then the previous 2 write errors to the console
detox[14376] ERROR: [exec.js/EXEC_FAIL, #15] "C:\Users\User_Name\AppData\Local\Android\Sdk\platform-tools\adb -s emulator-5554 shell "ps | grep \"com\.example\.nameOfProject$\""" failed with code = 1, stdout and stderr:
Although this function works, and the application starts, the tests go. Is it possible to solve this problem?
At the moment I had to change the line in AdroidDriver.js file:
if (waitAtStart) {
await sleep(500);
}
to
if (waitAtStart) {
await sleep(3000);
}
Detox is not supported officially on Windows as we don't have a way to run on Windows CI agents, the current support was added by the community. We were glad to accept it, but as noted above, can't maintain it.
Do you only see this in Windows? do you see it in any other OS?
@rotemmiz, as far as I can see, the issue is about a flaw in a quite naive mechanism of awaiting till the testee app actually starts running and gets PID assigned (so we can query it via pidof or ps and confirm it is running).
On one hand, I don't see harm to tweak a bit timings there and also refactor the code to use utils/retry (probably we can even make retries silent), but on another hand, it would be much better to have a less naive approach than polling for the process id with an interval.
As far as I understand from the description of this issue, it is not a blocker for the reporter of the issue, rather irritating noise in logs output, which is a fair enough statement.
Detox has some glitches on Windows, but IMO this particular issue albeit minor, but still is valid and not platform-specific.
It's an issue present on OSX as well. No, this isn't a blocker for anything, more of an annoyance (because it's not really an error)
Yes, @solkaz it is rather misleading because the console has red messages)
Any update for this ? I faced same issue with MacOS
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions.
Hello! Unfortunately this issue is still reproduced
@AntaninaKaltsova, @solkaz, I promise to take this as a first task when I return to Detox, hopefully on this week already.
Most helpful comment
@AntaninaKaltsova, @solkaz, I promise to take this as a first task when I return to Detox, hopefully on this week already.