AirtestProject / AirtestProject/Airtest
[Poco not Thread-safe error] Check if UI Exists in a Separate Thread
- Dominant language
- Python
- Stars
- 9.6k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Hi, I have a setup where I use one Thread to check if the Unity game got error, and the other Thread to run Airtest tests.
If that thread detects the error variable to have errors from the game, it stops the test thread.
However, I get this error if I try to detect if Unity UI Exists in a separate thread, while the other thread is running tests. [Both using poco.click, poco.exist functions]
Traceback here

**To Reproduce**
Steps to reproduce the behavior:
1. Write code,
```
while(true):
#use poco and check if UI exists
time.sleep(1)
```
2. Create one more thread to do the same, but do clicking
```
while(true):
#use poco and click on some button in-game
time.sleep(1)
```
3. Let it run, and encounter error. This happens if both threads call simplerpc.py's handle_message function.
**Expected behavior**
1. Provide a thread-safe solution so that multi-threaded approach can be applied using Airtest
**python version:** `python3.7.2`
**airtest version:** `1.0.27`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.