test: try fix for test_exchangews_ohlcv random failures
This commit is contained in:
@@ -138,7 +138,6 @@ async def test_exchangews_ohlcv(mocker, time_machine, caplog):
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Cleanup happened.
|
# Cleanup happened.
|
||||||
# Triggers 2nd call to un_watch_ohlcv_for_symbols which raises ValueError
|
|
||||||
exchange_ws.schedule_ohlcv("ETH/BTC", "1m", CandleType.SPOT)
|
exchange_ws.schedule_ohlcv("ETH/BTC", "1m", CandleType.SPOT)
|
||||||
|
|
||||||
# Verify final state
|
# Verify final state
|
||||||
@@ -149,10 +148,16 @@ async def test_exchangews_ohlcv(mocker, time_machine, caplog):
|
|||||||
("ETH/BTC", "1m", CandleType.SPOT),
|
("ETH/BTC", "1m", CandleType.SPOT),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Triggers 2nd call to un_watch_ohlcv_for_symbols which raises ValueError
|
||||||
|
exchange_ws._klines_watching.discard(("ETH/BTC", "1m", CandleType.SPOT))
|
||||||
|
await wait_for_condition(
|
||||||
|
lambda: log_has_re("Exception in _unwatch_ohlcv", caplog), timeout_=2.0
|
||||||
|
)
|
||||||
|
assert log_has_re("Exception in _unwatch_ohlcv", caplog)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
# Cleanup
|
# Cleanup
|
||||||
exchange_ws.cleanup()
|
exchange_ws.cleanup()
|
||||||
assert log_has_re("Exception in _unwatch_ohlcv", caplog)
|
|
||||||
|
|
||||||
|
|
||||||
async def test_exchangews_get_ohlcv(mocker, caplog):
|
async def test_exchangews_get_ohlcv(mocker, caplog):
|
||||||
|
|||||||
Reference in New Issue
Block a user