Skip to content

Start index jobs after the transaction commits, shorten index waits in ITs - #12712

Open
ErykKul wants to merge 3 commits into
developfrom
flaky-tests-fix
Open

ErykKul wants to merge 3 commits into
developfrom
flaky-tests-fix

Conversation

@ErykKul

@ErykKul ErykKul commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

Fixes the flaky search tests (SearchIT, DataRetrieverApiIT, see #12710 and #12658) and shortens the index waits in the ITs.

Commands call asyncIndexDataset from inside their transaction, and the background job can run before that transaction commits. When it does, the permission doc misses the creator and the index time is never written (the dvObjectToModify is null errors in the server log), so the dataset stays invisible and the tests wait for nothing. This has been possible since indexing on create became async in #9558; the container based CI is fast enough to hit it.

Index jobs, the index time update and role reindexing now fire a CDI event that runs after the transaction has committed (IndexingRequest, IndexingRequestObserver). No callers change, and the 1 s sleep in IndexAsync goes away.

On the test side sleepForReindex polls every 100 ms instead of sleeping a fixed 1.5 s, the dev/CI Solr soft commits every 100 ms, and sleepForDatasetIndex fails on timeout instead of warning.

Which issue(s) this PR closes:

  • Closes #

Special notes for your reviewer:

Verified against the Docker dev stack: both classes pass, 0 index-time errors in the server log (CI runs had 25 to 80), SearchIT in 137 s instead of 409 s.

Suggestions on how to test this:

Run SearchIT and DataRetrieverApiIT against the dev stack with -Ddataverse.test.solr.softcommit.millis=100, then check that docker logs dev_dataverse 2>&1 | grep -c 'dvObjectToModify" is null' prints 0.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

No.

Is there a release notes update needed for this change?:

Yes: indexing now starts only after the transaction that changed a dataset or its permissions has committed, so a new dataset no longer risks being missing from search for its creator until the next reindex.

Additional documentation:

The testing guide documents -Ddataverse.test.solr.softcommit.millis.

@coveralls

coveralls commented Sep 16, 2026

Copy link
Copy Markdown

Coverage Status

Coverage is 25.438%flaky-tests-fix into develop. No base build found for develop.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Sep 16, 2026

Copy link
Copy Markdown

Test Results

405 tests   390 ✅  29m 58s ⏱️
 55 suites   15 💤
 55 files      0 ❌

Results for commit 3aaafd5.

♻️ This comment has been updated with latest results.

@github-actions

This comment has been minimized.

@ErykKul ErykKul moved this to Ready for Review ⏩ in IQSS Dataverse Project Sep 16, 2026
@ErykKul ErykKul added the Size: 3 A percentage of a sprint. 2.1 hours. label Sep 16, 2026
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:flaky-tests-fix
ghcr.io/gdcc/configbaker:flaky-tests-fix

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: 3 A percentage of a sprint. 2.1 hours.

Projects

Status: Ready for Review ⏩

Development

Successfully merging this pull request may close these issues.

2 participants