Skip to content

Fix allowed_warnings placement in system ingest processor YAML test#20770

Merged
andrross merged 1 commit intoopensearch-project:mainfrom
andrross:flaky-system-ingest-test
Mar 4, 2026
Merged

Fix allowed_warnings placement in system ingest processor YAML test#20770
andrross merged 1 commit intoopensearch-project:mainfrom
andrross:flaky-system-ingest-test

Conversation

@andrross
Copy link
Member

@andrross andrross commented Mar 3, 2026

The v2 index template test had allowed_warnings on the document index step, but the warning about overlapping template patterns is emitted during put_index_template for v2 composable templates, not at index time. Move allowed_warnings to the correct step with the actual warning message returned by the server.

Related Issues

Resolves #18484

Check List

  • Functionality includes testing.

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.

The v2 index template test had allowed_warnings on the document index
step, but the warning about overlapping template patterns is emitted
during put_index_template for v2 composable templates, not at index
time. Move allowed_warnings to the correct step with the actual warning
message returned by the server.

Signed-off-by: Andrew Ross <andrross@amazon.com>
@andrross andrross requested a review from a team as a code owner March 3, 2026 22:10
@github-actions github-actions bot added >test-failure Test failure from CI, local build, etc. autocut flaky-test Random test failure that succeeds on second run labels Mar 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ Recommended focus areas for review

Warning Message Accuracy

The new allowed_warnings message references the template name "example-template" and pattern "template-*" which are hardcoded. If the server-side warning message format changes between OpenSearch versions, this test will fail. Verify that the exact warning string matches what the server emits in all supported versions.

allowed_warnings:
  - "index template [example-template] has index patterns [template-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [example-template] will take precedence during new index creation"

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Verify warning message matches exactly

The allowed_warnings field is placed inside the do block alongside
indices.put_index_template, but in the REST test YAML spec, allowed_warnings should
typically be a sibling key at the same level as the action key within the do block.
Verify that this placement is correct and that the warning message matches exactly
what Elasticsearch emits for this operation, as a mismatch will cause the test to
fail or the warning to go unhandled.

plugins/examples/system-ingest-processor/src/yamlRestTest/resources/rest-api-spec/test/example-system-ingest-processor/20_system_ingest_processor.yml [114-117]

 - do:
     allowed_warnings:
       - "index template [example-template] has index patterns [template-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [example-template] will take precedence during new index creation"
-    # test v2 template
     indices.put_index_template:
+      name: example-template
+      body:
Suggestion importance[1-10]: 3

__

Why: The suggestion asks to verify that the allowed_warnings placement and message are correct, but the placement shown in both existing_code and improved_code is essentially the same (the only difference is removing the comment). This is a "verify" type suggestion with no concrete fix, and the improved_code doesn't meaningfully differ from existing_code.

Low

@andrross
Copy link
Member Author

andrross commented Mar 3, 2026

I believe the reason this is flaky is because the "global" template is only rarely added by the test framework:

final Request request = new Request("PUT", "/_template/global");

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

✅ Gradle check result for d7f2844: SUCCESS

@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.29%. Comparing base (533b871) to head (d7f2844).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #20770      +/-   ##
============================================
- Coverage     73.30%   73.29%   -0.02%     
- Complexity    72134    72156      +22     
============================================
  Files          5794     5794              
  Lines        329806   329806              
  Branches      47593    47593              
============================================
- Hits         241766   241717      -49     
- Misses        68555    68715     +160     
+ Partials      19485    19374     -111     

☔ 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.

@andrross andrross merged commit a8c5aa9 into opensearch-project:main Mar 4, 2026
39 of 40 checks passed
@andrross andrross deleted the flaky-system-ingest-test branch March 4, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autocut flaky-test Random test failure that succeeds on second run skip-changelog >test-failure Test failure from CI, local build, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AUTOCUT] Gradle Check Flaky Test Report for ExampleSystemIngestProcessorClientYamlTestSuiteIT

2 participants