Skip to content

SOLR-13943: Move testDateMathInStart into its own test class with a polling wait - #5089

Open
nick-boss-tech wants to merge 25 commits into
apache:mainfrom
nick-boss-tech:solr-13943-submit
Open

nick-boss-tech wants to merge 25 commits into
apache:mainfrom
nick-boss-tech:solr-13943-submit

Conversation

@nick-boss-tech

@nick-boss-tech nick-boss-tech commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖 (posted on behalf of Nick Shanin)

https://issues.apache.org/jira/browse/SOLR-13943

What happens today

testDateMathInStart does not run in normal CI. When it runs, it waits on the test's own ZooKeeper watcher.

The method sits in TimeRoutedAliasUpdateProcessorTest. That class has a class-level @AwaitsFix for SOLR-13059 (annotation), so its methods are skipped in normal mode. The method also had its own @AwaitsFix for SOLR-13943.

After the add, the test waits on a latch that counts down when its own watcher on /aliases.json fires. Then it reads the start value from the cluster state provider.

What this change does

The test moves to its own class with no skip annotation. Its second wait now polls the provider.

  • Stack: this branch sits on the SOLR-13696 branch at 1d0b8a0a73cd, which is an ancestor of this head. Until SOLR-13696 lands, this PR's diff against main also shows that PR's production and test changes (TimeRoutedAlias.java, CreateAlias.java, and the routed-alias test files).
  • The method moves to TimeRoutedAliasDateMathInStartTest, a new class. It has the same base class and no @AwaitsFix (class). The test is at L84-L160.
  • The wait after the add now polls the cluster state provider every 100 ms, for up to 30 seconds. On an HTTP-based provider, it first asks the provider to refresh the alias. The test passes once the start value parses as an instant. It fails at the timeout (poll loop). The old wait had no time limit.
  • The first wait, before the add, still uses the test's own watcher (L109). This change leaves it as it was.
  • The new comment gives the reason. The watcher can fire before the provider has refreshed its aliases (comment).
  • The commits added on top of SOLR-13696 change three files only, and no production code: the changelog fragment, TimeRoutedAliasDateMathInStartTest.java, and TimeRoutedAliasUpdateProcessorTest.java.

Proof

The moved test passes in normal mode, and the nearby suites pass too.

  • Gate on aa14590 (receipt receipts/SOLR-13943.md on coordination): tidy and Error Prone compile pass. In normal mode, TimeRoutedAliasDateMathInStartTest passes 2 of 2 with no skip, TimeRoutedAliasUpdateProcessorTest passes 12 with 2 skipped (both testDateMathInStart, which this PR moves), and Category 12, Dimensional 4 and CreateAliasAPI 26 pass, with 0 failures. :solr:core:check -x test passes.
  • TimeRoutedAliasDateMathInStartTest testDateMathInStart: 1 of 1 in normal mode.
  • CategoryRoutedAliasUpdateProcessorTest 6 of 6, DimensionalRoutedAliasUpdateProcessorTest 2 of 2, and CreateAliasAPITest 13 of 13.
  • The module checks pass.

These counts are from runs at this head.

At the earlier head cc155cf68e1d (2026-10-09), with the awaitsfix group enabled, TimeRoutedAliasUpdateProcessorTest runs six tests. Five pass. testPreemptiveCreation fails. The change does not touch that test. The failure is the pre-existing timing race that the method's comment describes (assertion).

Limits

SOLR-13059 is fixed on the SOLR-13696 branch. PR 5088 (head 960355f) removes the class-level skip. This branch merges that head at aa14590, so the annotation is removed here too.

  • The six tests in TimeRoutedAliasUpdateProcessorTest run in normal mode on this head. No further change is planned.
  • No run of the moved test against the base code is on record. This PR does not yet show that the test fails without the change.
  • This branch merges the SOLR-13696 branch head 960355fce3 at aa14590303. It is a merge, not a rebase, so no history was rewritten. Until PR 5088 lands, the PR diff against main includes the SOLR-13696 and SOLR-13059 commits. When PR 5088 lands, the diff shrinks to this PR's own commits.

Changelog: changelog/unreleased/SOLR-13943.yml (restored byte-identical at this head).

AI assistance

AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution.

….addDocsAndCommit and re-enable the test

Hypothetical, unrun regression test; see SOLR-13696-TESTING.md.
…defines

Category tests used ship_name_en, which the server _default configset never defines, so
autoCreateFields=false rejects every document. Use the string dynamic field ship_name_s.

The explicit commit now fails with a clear message if the alias is not listed, instead of a
null dereference.
…rovider for the rewritten router start

Hypothetical, unrun regression test; see SOLR-13943-TESTING.md.
@nick-boss-tech nick-boss-tech changed the title SOLR-13943: TimeRoutedAliasUpdateProcessorTest.testDateMathInStart: multi-threaded race condition due to ZK assumptions SOLR-13943: Move testDateMathInStart into its own test class with a polling wait Oct 9, 2026
@nick-boss-tech
nick-boss-tech marked this pull request as ready for review October 9, 2026 23:26
nick-boss-tech added a commit to nick-boss-tech/solr that referenced this pull request Oct 15, 2026
nick-boss-tech added a commit to nick-boss-tech/solr that referenced this pull request Oct 18, 2026
…st hold

# Conflicts:
#	solr/core/src/test/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessorTest.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant