FreeOpcUa / opcua-asyncio

OPC UA library for python >= 3.7
GNU Lesser General Public License v3.0
1.04k stars 345 forks source link

Race/block condition when running client and server in same asyncio eventloop (under pytest) #1603

Open rambo opened 3 months ago

rambo commented 3 months ago

all async as per title

Describe the bug
When running both server and client under pytest polling values and change notifications fail with timeout.

To Reproduce

Or see https://gitlab.com/advian-oss/python-asynuapytestexample/-/merge_requests/1 CI test results

Expected behavior
Running both server and client under same eventloop should work normally.

Version
Python-Version: 3.11
opcua-asyncio Version (e.g. master branch, 0.9): asyncua==1.1.0

rambo commented 3 months ago

Root cause might be on the client side, I will update tests to demonstrate later but when I moved the server to a subprocess in the project where I originally ran into this it didn't help.

oroulet commented 3 months ago

I have not looked at your code yet but we run clients and server in same loop all the time in tests so your problem must be some special case. Or a bug on your side