AirtestProject / AirtestProject/Airtest

[Poco not Thread-safe error] Check if UI Exists in a Separate Thread

Open
#497 1 comment 0 reactions 0 assignees View on GitHub
repo/poco
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
![image](https://user-images.githubusercontent.com/19833754/63154224-b8a97a80-c042-11e9-805b-1018f7b7b4c8.png)

**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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.