diff --git a/py/server/tests/test_table.py b/py/server/tests/test_table.py index b37b89c8c14..eba1e3ad8ca 100644 --- a/py/server/tests/test_table.py +++ b/py/server/tests/test_table.py @@ -567,7 +567,10 @@ def test_snapshot_when_with_history(self): snapshot_hist = self.test_table.snapshot_when(t, history=True) self.assertFalse(snapshot_hist.j_table.isFailed()) self.wait_ticking_table_update(t, row_count=10, timeout=2) - self.assertTrue(snapshot_hist.j_table.isFailed()) + # we have not waited for a whole cycle yet, wait for the shared lock to guarantee cycle is over + # to ensure snapshot_hist has had the opportunity to process the update we just saw + with update_graph.shared_lock(t): + self.assertTrue(snapshot_hist.j_table.isFailed()) def test_agg_all_by(self): test_table = empty_table(10)