• Julien Prigent's avatar
    [HaClient] Fix test race condition · b5edbdeb
    Julien Prigent authored
    According to the logs of the recent test failure, there's a small window when we test the connection is established where we have a socket connected but don't have the session created yet, and this is throwing exception when trying to disconnect because the renew loop is not yet created.
    
    This is caused by the HaManager (in charge of connecting/reconnecting the clients) running in its own task, thus we're not in the usual await connect(); await disconnect() scenario.
    This can also arguably be fixed at the client level by checking if
    the renew loop exist on disconnect.
    b5edbdeb
conftest.py 13.8 KB