test: fix proper wait for data available from history

This commit is contained in:
2025-04-15 21:23:33 +02:00
committed by wakonig_k
parent 3a2c6edcc9
commit 56faa99531
2 changed files with 21 additions and 39 deletions
@@ -131,14 +131,12 @@ def test_async_plotting(qtbot, bec_client_lib, connected_client_gui_obj):
status.wait()
# Wait for the scan to finish and the data to be available in history
# Wait until scan_id is in history
def _wait_for_scan_in_history():
if len(client.history) == 0:
return False
# Once items appear in storage, the last one hast to be the one we just scanned
return client.history[-1].metadata.bec["scan_id"] == status.scan.scan_id
# Get scan item from history
scan_item = client.history.get_by_scan_id(s.scan.scan_id)
return scan_item is not None
qtbot.waitUntil(_wait_for_scan_in_history, timeout=10000)
qtbot.waitUntil(_wait_for_scan_in_history, timeout=7000)
# Get all data
msgs = client.connector.xrange(
MessageEndpoints.device_async_readback(