AirtestProject / AirtestProject/Airtest

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

Đang mở
#497 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
repo/poco
Ngôn ngữ chính
Python
Star
9.6k
Fork
1.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.