thegridelectric / gw-scada-spaceheat-python

GridWorks SCADA for space heating
MIT License
5 stars 2 forks source link

Intermittent failure of test_await_for #141

Open anschweitzer opened 1 year ago

anschweitzer commented 1 year ago

Seen on mac.

Failed with:

            @pytest.mark.asyncio
            async def test_await_for():

                delay_time = .01
                timeout = delay_time * 2
                retry_duration = delay_time / 4
                min_expected = delay_time + (2 * retry_duration)
                sw = StopWatch()

                # Happy path
                with sw:
                    await await_for(Delay(delay_time), timeout, retry_duration=retry_duration)
                assert sw.elapsed >= delay_time
        >       assert sw.elapsed < min_expected
        E       assert 0.015224933624267578 < 0.015
        E        +  where 0.015224933624267578 = <tests.utils.StopWatch object at 0x1057c4690>.elapsed