How to connect DeviceProxy to device launched via MultiDeviceTestContext
Tests that use MultiDeviceTestContext
will sometimes pass, sometimes error out with a message objecting that environment variable TANGO_HOST
is not defined.
If you set that environment variable, MultiDeviceTestContext
will try to connect to a database at that location. And if you stand up a database there, it will talk to that database!
I can see in the code that the tango database is supposed to be mocked out with a text file. It seems that that mocking isn't always working.
I haven't found a way to fix the problem, but I can make the problem happen every time by putting a time.sleep(5)
at the top of the post init callback. This makes me think that there is some kind of race condition happening.
The issue occurs regardless of whether your asynchronous context is threads or processes, but it is worse for threads.