-
Notifications
You must be signed in to change notification settings - Fork 644
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
Running several tests simultaneously on the same machine can lead to errors #209
Comments
I've sent a pull request that should fix this issue: #208 |
Just tested, everything works fine. |
Do you mean that you can't reproduce the problem? |
yes, I also read the code, nothing need to change, I think. |
This is how to reproduce it:
test1.py: https://gist.github.com/artikz/c4e9d87820f9dad2a4bacab11a45692b They just initialize uiautomator.Device() and take screenshot in 60 seconds after initialization.
$ adb forward --remove-all
$ adb forward --list You'll see that there is only one forward set up. |
Maybe you can try my fork version https://github.com/openatx/atx-uiautomator but I remember I did not change the code related to |
We also faced similar issue while executing on 2 devices simultaneously |
@codeskyblue, reproduced it with your fork as well |
@artikz finally, I meet the same problem, like you. try to fix it tomorrow. |
The fix is here: #208 |
I see that pr, very good code with lot of test codes, I just need a little change in order to use in atx-uiautomator |
Still we are observing some issues in CI executions even after using @artikz fix. Need to debug |
@SivaKranthiKumar, what issues do you see? Same as here? (I.e., test talks to incorrect device) |
Yeah. Other device operations were happening in some other device. But didn't debug them yet. We did apply your fix |
This is interesting. If you will be able to understand why it didn't work, please, let me know |
For example, let's have the following sequence of statements executed in the given order in two different processes:
Process 1: device = uiautomator.Device(serial="1")
Process 2: device = uiautomator.Device(serial="2")
Process 1: device.screen.on()
Process 2: device.screen.on()
After this both processes will be attached to the same device "2", because local_port calculated in AutomatorServer.init() is not used until AutomatorServer.start(), and there is no way for process 2 to know that the port is already used when it selects it.
In addition adb forward will silently rebind port by default without returning an error, so neither of the processes will know that it talks to incorrect device.
The text was updated successfully, but these errors were encountered: