Skip to content

Fix BlockTransferManagerTests to extend OpenSearchTestCase instead of LuceneTestCase - #21363

Merged
cwperks merged 1 commit into
opensearch-project:mainfrom
MayankHarsh03:fix/block-transfer-manager-tests-base-class
Apr 28, 2026
Merged

Fix BlockTransferManagerTests to extend OpenSearchTestCase instead of LuceneTestCase#21363
cwperks merged 1 commit into
opensearch-project:mainfrom
MayankHarsh03:fix/block-transfer-manager-tests-base-class

Conversation

@MayankHarsh03

Copy link
Copy Markdown
Contributor

Description

BlockTransferManagerTests was extending LuceneTestCase directly, which causes sysout check failures in CI since the test uses loggers that print to console during execution. Changed the base class to OpenSearchTestCase which already includes @SuppressSysoutChecks and follows the project convention for all tests in the server/ module.

Related Issues

Related to #21355

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.

@MayankHarsh03
MayankHarsh03 requested a review from a team as a code owner April 27, 2026 11:38
@github-actions

github-actions Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

(Review updated until commit a485fba)

Here are some key observations to aid the review process:

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

@github-actions

Copy link
Copy Markdown
Contributor

❌ Gradle check result for 5bcabc1: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@mgodwan

mgodwan commented Apr 27, 2026

Copy link
Copy Markdown
Member
Execution failed for task ':server:spotlessJavaCheck'.
> The following files had format violations:
      src/test/java/org/opensearch/storage/common/BlockTransferManagerTests.java
          @@ -12,7 +12,6 @@
           
           import·org.apache.lucene.store.FSDirectory;
           import·org.apache.lucene.store.IOContext;
          -import·org.opensearch.test.OpenSearchTestCase;
           import·org.opensearch.Version;
           import·org.opensearch.cluster.metadata.IndexMetadata;
           import·org.opensearch.common.UUIDs;
          @@ -23,6 +22,7 @@
           import·org.opensearch.index.store.remote.utils.TransferManager;
           import·org.opensearch.node.Node;
           import·org.opensearch.storage.indexinput.BlockFetchRequest;
          +import·org.opensearch.test.OpenSearchTestCase;
           import·org.opensearch.threadpool.ThreadPool;
           import·org.junit.After;
           import·org.junit.Assert;
  Run './gradlew spotlessApply' to fix all violations.

@MayankHarsh03
MayankHarsh03 force-pushed the fix/block-transfer-manager-tests-base-class branch from 5bcabc1 to 0d1982f Compare April 27, 2026 12:44
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 0d1982f

@MayankHarsh03
MayankHarsh03 force-pushed the fix/block-transfer-manager-tests-base-class branch from 0d1982f to 8e79bf9 Compare April 27, 2026 12:46
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 8e79bf9

@github-actions

Copy link
Copy Markdown
Contributor

✅ Gradle check result for 8e79bf9: SUCCESS

@codecov

codecov Bot commented Apr 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.47%. Comparing base (436e4a6) to head (a485fba).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #21363      +/-   ##
============================================
+ Coverage     73.34%   73.47%   +0.12%     
- Complexity    74223    74333     +110     
============================================
  Files          5958     5958              
  Lines        337309   337359      +50     
  Branches      48664    48687      +23     
============================================
+ Hits         247408   247870     +462     
+ Misses        70188    69754     -434     
- Partials      19713    19735      +22     

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

… LuceneTestCase

BlockTransferManagerTests was extending LuceneTestCase directly which causes
sysout check failures since the test uses loggers that print to console.
Changed to extend OpenSearchTestCase which already includes
@SuppressSysoutChecks and follows the project convention for all server tests.

Signed-off-by: Mayank Harsh <mayankmh@amazon.com>
@MayankHarsh03
MayankHarsh03 force-pushed the fix/block-transfer-manager-tests-base-class branch from 8e79bf9 to a485fba Compare April 27, 2026 17:42
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit a485fba

@github-actions

Copy link
Copy Markdown
Contributor

✅ Gradle check result for a485fba: SUCCESS

@cwperks
cwperks merged commit 30920ea into opensearch-project:main Apr 28, 2026
15 of 16 checks passed
krishna-ggk pushed a commit to krishna-ggk/OpenSearch that referenced this pull request Apr 28, 2026
… LuceneTestCase (opensearch-project#21363)

BlockTransferManagerTests was extending LuceneTestCase directly which causes
sysout check failures since the test uses loggers that print to console.
Changed to extend OpenSearchTestCase which already includes
@SuppressSysoutChecks and follows the project convention for all server tests.

Signed-off-by: Mayank Harsh <mayankmh@amazon.com>
Co-authored-by: Mayank Harsh <mayankmh@amazon.com>
imRishN pushed a commit to imRishN/OpenSearch that referenced this pull request May 8, 2026
… LuceneTestCase (opensearch-project#21363)

BlockTransferManagerTests was extending LuceneTestCase directly which causes
sysout check failures since the test uses loggers that print to console.
Changed to extend OpenSearchTestCase which already includes
@SuppressSysoutChecks and follows the project convention for all server tests.

Signed-off-by: Mayank Harsh <mayankmh@amazon.com>
Co-authored-by: Mayank Harsh <mayankmh@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants