Skip to content

Stabilize flaky test_ravenDB_16334 (reference-reindex race)#298

Merged
poissoncorp merged 1 commit into
ravendb:v7.2from
poissoncorp:fix-flaky-test-ravenDB-16334
Jun 19, 2026
Merged

Stabilize flaky test_ravenDB_16334 (reference-reindex race)#298
poissoncorp merged 1 commit into
ravendb:v7.2from
poissoncorp:fix-flaky-test-ravenDB-16334

Conversation

@poissoncorp

Copy link
Copy Markdown
Contributor

Problem

test_can_wait_for_indexes_with_load_after_save_changes_* intermittently fails in CI:

AssertionError: '42' != '21.5'

MyIndex projects related/A into the result via LoadDocument. The first query (line 60) is guarded by wait_for_indexing (line 57), but the second query (after updating related.value = 42) relies solely on wait_for_indexes_after_save_changes. Updating a referenced document marks the index stale asynchronously, so the assertion occasionally observes the stale 21.5.

Fix

Add self.wait_for_indexing(self.store) before the second assertion, mirroring the guard already used before the first query. Fixes both the _single_index and _all_indexes variants (shared _internal helper). The wait_for_indexes_after_save_changes call is kept so that code path is still exercised.

No production code changed — test-only.

@poissoncorp poissoncorp merged commit 1ab9583 into ravendb:v7.2 Jun 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant