Skip to content

Fix green_mode bug in TestContext

Closes #543 (closed), #546 (closed) and #509 (closed)

The origin of these bugs is the following:

When we create a server, which uses green_mode != Synchronous, then during server start-up we create a corresponding executor, "linked" to the server sub-thread. If we later make any call from the main thread - the get_executor function returns us this executor, and later in the run function the in_executor_context check willl be False and this call executes as a synchronous independent of the requested mode. Note, that this problem is specific to the TestContext, where we have two threads: one for server, the second one for DeviceProxy.

To fix it I propose, that after we start server in TestContext, we force a new green_mode executor, "linked" to the main thread, to be created and set it as the global one, so any new DeviceProxy, we made will be executed in this executor.

Edited by Yury Matveyev

Merge request reports