Skip to content

Commit dad55a9

Browse files
committed
💚 Check that ACCESSDB is drained
1 parent 78d53e7 commit dad55a9

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tests/workflows/test_shef_parser.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,15 @@ def _check_access_entry(txn):
8383
assert updated == 7
8484
# Check 0: Ensure the HADSDB queue is done
8585
attempt = 0
86-
while CTX["HADSDB"].threadpool._queue.qsize() > 0:
87-
attempt += 1
88-
print("Waiting for HADSDB queue to drain...")
89-
yield deferLater(reactor, 0.1, lambda: None)
90-
if attempt > 30:
91-
pytest.fail("HADSDB queue did not drain in time")
92-
93-
# Check 2: Assume accessdb is updated by now :/
86+
for db in ["HADSDB", "ACCESSDB"]:
87+
while CTX[db].threadpool._queue.qsize() > 0:
88+
attempt += 1
89+
print(f"Waiting for {db} queue to drain...")
90+
yield deferLater(reactor, 0.1, lambda: None)
91+
if attempt > 30:
92+
pytest.fail(f"{db} queue did not drain in time")
93+
94+
# Check 2: see that current_shef is good
9495
result = yield CTX["ACCESSDB"].runInteraction(_check_access_entry)
9596
assert result[0]["value"] is None
9697
# Check 3: Ensure the value in the current_queue is None

0 commit comments

Comments
 (0)