Skip to content

Conversation

@cwperks
Copy link
Member

@cwperks cwperks commented Aug 15, 2025

Description

Similar to #18988, this PR resolves an issue seen in CCR repo seen on the 3.3 version increment: opensearch-project/cross-cluster-replication#1571

One of the tests reads a classpath resource and then copies to the config directory of one of the testclusters and fails bc the javaagent is forbidding it from writing. See the relevant test lines here: https://github.com/opensearch-project/cross-cluster-replication/blob/main/src/test/kotlin/org/opensearch/replication/integ/rest/StartReplicationIT.kt#L628-L635

Fixes the following error:

REPRODUCE WITH: ./gradlew ':integTest' --tests 'org.opensearch.replication.integ.rest.ResumeReplicationIT.test that replication fails to resume when custom analyser is not present in follower' -Dtests.seed=40961F1E09AB0E46 -Dtests.security.manager=true -Dtests.locale=ar-SD -Dtests.timezone=SystemV/AST4 -Druntime.java=24

> Task :integTest

ResumeReplicationIT > test that replication fails to resume when custom analyser is not present in follower FAILED
    java.lang.SecurityException: Denied OPEN (read/write) access to file: /__w/cross-cluster-replication/cross-cluster-replication/build/testclusters/leaderCluster-0/config/synonyms.txt, domain: ProtectionDomain  (file:/__w/cross-cluster-replication/cross-cluster-replication/build/classes/kotlin/test/ <no signer certificates>)
     jdk.internal.loader.ClassLoaders$AppClassLoader@659e0bfd
     <no principals>
     java.security.Permissions@2a07c730 (
    )
        at __randomizedtesting.SeedInfo.seed([40961F1E09AB0E46:B999BD0A425312AD]:0)
        at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:244)
        at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:426)
        at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.newOutputStream(FilterFileSystemProvider.java:200)
        at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.newOutputStream(FilterFileSystemProvider.java:200)
        at org.apache.lucene.tests.mockfile.HandleTrackingFS.newOutputStream(HandleTrackingFS.java:132)
        at org.apache.lucene.tests.mockfile.HandleTrackingFS.newOutputStream(HandleTrackingFS.java:132)
        at org.apache.lucene.tests.mockfile.HandleTrackingFS.newOutputStream(HandleTrackingFS.java:132)
        at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.newOutputStream(FilterFileSystemProvider.java:200)
        at java.base/java.nio.file.Files.newOutputStream(Files.java:215)
        at java.base/java.nio.file.Files.copy(Files.java:2852)
        at org.opensearch.replication.integ.rest.ResumeReplicationIT.test that replication fails to resume when custom analyser is not present in follower(ResumeReplicationIT.kt:177)

One small change would still be necessary on CCR side to add a systemProp when running integTests:

systemProperty 'testclusters.dir', project.layout.buildDirectory.get().file("testclusters").asFile.absolutePath

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.

@cwperks cwperks requested a review from a team as a code owner August 15, 2025 17:50
Signed-off-by: Craig Perkins <[email protected]>
@github-actions
Copy link
Contributor

❌ Gradle check result for 5c05514: 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?

@github-actions
Copy link
Contributor

✅ Gradle check result for 5c05514: SUCCESS

@codecov
Copy link

codecov bot commented Aug 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.91%. Comparing base (10ff9d3) to head (c3d4b77).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19085      +/-   ##
============================================
- Coverage     72.94%   72.91%   -0.04%     
+ Complexity    69523    69458      -65     
============================================
  Files          5647     5647              
  Lines        319166   319166              
  Branches      46165    46165              
============================================
- Hits         232828   232714     -114     
- Misses        67539    67601      +62     
- Partials      18799    18851      +52     

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

@github-actions
Copy link
Contributor

✅ Gradle check result for c3d4b77: SUCCESS

@cwperks cwperks merged commit 66836f0 into opensearch-project:main Aug 16, 2025
31 checks passed
RajatGupta02 pushed a commit to RajatGupta02/OpenSearch that referenced this pull request Aug 18, 2025
* Grant access to testclusters dir for tests

Signed-off-by: Craig Perkins <[email protected]>

* Fix CHANGELOG

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
atris pushed a commit to atris/OpenSearch that referenced this pull request Aug 28, 2025
* Grant access to testclusters dir for tests

Signed-off-by: Craig Perkins <[email protected]>

* Fix CHANGELOG

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
kh3ra pushed a commit to kh3ra/OpenSearch that referenced this pull request Sep 5, 2025
* Grant access to testclusters dir for tests

Signed-off-by: Craig Perkins <[email protected]>

* Fix CHANGELOG

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
vinaykpud pushed a commit to vinaykpud/OpenSearch that referenced this pull request Sep 26, 2025
* Grant access to testclusters dir for tests

Signed-off-by: Craig Perkins <[email protected]>

* Fix CHANGELOG

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
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