Skip to content

Add fix for the tests - #21657

Merged
bharath-techie merged 1 commit into
opensearch-project:mainfrom
alchemist51:fix-recovery
May 14, 2026
Merged

Add fix for the tests#21657
bharath-techie merged 1 commit into
opensearch-project:mainfrom
alchemist51:fix-recovery

Conversation

@alchemist51

@alchemist51 alchemist51 commented May 14, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes the broken gradle post this: #21553

Related Issues

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

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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: Arpit Bandejiya <abandeji@amazon.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Use lenient mocking for MapperService

The mocked MapperService only stubs getIndexSettings(). If other methods are called
on this mock during engine operations, they will return null or throw exceptions,
potentially causing test failures. Consider using lenient() mocking or stubbing
additional commonly-used methods.

server/src/test/java/org/opensearch/index/engine/DataFormatAwareEngineRecoveryTests.java [278-279]

-MapperService mapperService = mock(MapperService.class);
+MapperService mapperService = mock(MapperService.class, withSettings().lenient());
 when(mapperService.getIndexSettings()).thenReturn(indexSettings);
Suggestion importance[1-10]: 5

__

Why: The suggestion correctly identifies that the mock MapperService only stubs getIndexSettings(), which could cause issues if other methods are called. However, without evidence that other methods are actually invoked during tests, this is a preventive measure rather than fixing an actual bug. The use of lenient mocking is a reasonable defensive practice but may not be strictly necessary.

Low

@github-actions

Copy link
Copy Markdown
Contributor

✅ Gradle check result for c222bf0: SUCCESS

@codecov

codecov Bot commented May 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.45%. Comparing base (5efe7ae) to head (c222bf0).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #21657      +/-   ##
============================================
- Coverage     73.51%   73.45%   -0.06%     
- Complexity    74667    74690      +23     
============================================
  Files          5981     5983       +2     
  Lines        338840   339070     +230     
  Branches      48860    48882      +22     
============================================
- Hits         249084   249076       -8     
- Misses        69890    70143     +253     
+ Partials      19866    19851      -15     

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

@bharath-techie bharath-techie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bharath-techie
bharath-techie merged commit b711b94 into opensearch-project:main May 14, 2026
34 checks passed
@alchemist51
alchemist51 deleted the fix-recovery branch May 14, 2026 13:01
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.

2 participants