Skip to content

Commit 1ab9583

Browse files
authored
Merge pull request #298 from poissoncorp/fix-flaky-test-ravenDB-16334
Stabilize flaky test_ravenDB_16334 (reference-reindex race)
2 parents 50774a1 + d9d36e4 commit 1ab9583

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

ravendb/tests/jvm_migrated_tests/issues_tests/test_ravenDB_16334.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ def _can_wait_for_indexes_with_load_after_save_changes_internal(self, all_indexe
7272
related.value = 42
7373
session.save_changes()
7474

75+
# MyIndex references related/A via LoadDocument, so updating it marks the
76+
# index stale asynchronously. Guard the assertion against that reference-
77+
# reindex race the same way the first query is guarded by wait_for_indexing
78+
# above; otherwise the query can observe the stale value (21.5) intermittently.
79+
self.wait_for_indexing(self.store)
80+
7581
# assert
7682
with self.store.open_session() as session:
7783
result = session.query_index_type(MyIndex, MyIndex.Result).select_fields(MyIndex.Result).single()

0 commit comments

Comments
 (0)