Skip to content

Comments

Flaky test fix#1574

Open
bowenlan-amzn wants to merge 1 commit intoopensearch-project:mainfrom
bowenlan-amzn:flaky
Open

Flaky test fix#1574
bowenlan-amzn wants to merge 1 commit intoopensearch-project:mainfrom
bowenlan-amzn:flaky

Conversation

@bowenlan-amzn
Copy link
Member

@bowenlan-amzn bowenlan-amzn commented Jan 26, 2026

Description

Summary

  • Fix flaky test test multi-tier rollup with cardinality in RollupActionIT

Test plan

  • Verified test passes with the previously failing seed:
./gradlew ':integTest' --tests 'org.opensearch.indexmanagement.indexstatemanagement.action.RollupActionIT.test multi-tier rollup with cardinality' -Dtests.seed=B2B48E214ECA5C1 -Dtests.security.manager=false -Dtests.locale=dz-BT -Dtests.timezone=Etc/GMT-6
  • Verified all RollupActionIT tests pass

Issue

The test was flaky when running with certain locales (e.g., dz-BT Dzongkha/Bhutan).

Root cause: String.format("%02d", ...) produces locale-specific digits. In the Dzongkha locale, this outputs Tibetan numerals (༠༡, ༠༢, etc.) instead of ASCII digits (01, 02, etc.). This caused timestamps like 2024-01-01T༠༡:00:00Z to fail ISO 8601 date parsing, resulting in all bulk index operations failing silently.

Changes

  1. Use Locale.ROOT for timestamp formatting - Ensures ASCII digits are always used regardless of test locale
  2. Add bulk response error checking - Fails fast if bulk indexing encounters errors, making future issues easier to diagnose
  3. Create index before attaching ISM policy - Prevents potential race condition where ISM could start processing before data is indexed

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.50%. Comparing base (ffe568f) to head (1718ac1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1574      +/-   ##
==========================================
+ Coverage   76.39%   76.50%   +0.11%     
==========================================
  Files         381      381              
  Lines       18058    18058              
  Branches     2501     2501              
==========================================
+ Hits        13796    13816      +20     
+ Misses       2991     2974      -17     
+ Partials     1271     1268       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bowenlan-amzn bowenlan-amzn marked this pull request as ready for review January 26, 2026 02:10
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