Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Defaut tests which extend OpenSearchTestCase don't work #4077

Closed
willyborankin opened this issue Feb 26, 2024 · 4 comments
Closed

[BUG] Defaut tests which extend OpenSearchTestCase don't work #4077

willyborankin opened this issue Feb 26, 2024 · 4 comments
Labels
bug Something isn't working triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable.

Comments

@willyborankin
Copy link
Collaborator

What is the bug?

If you tray to create any test which extends OpenSearchTestCase such test failes with such exception:

java.lang.RuntimeException: unable to install test security manager
	at org.opensearch.bootstrap.BootstrapForTesting.<clinit>(BootstrapForTesting.java:199)
	at org.opensearch.test.OpenSearchTestCase.<clinit>(OpenSearchTestCase.java:275)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:467)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$2.run(RandomizedRunner.java:623)
Caused by: java.lang.IllegalStateException: codebase property already set: codebase.kafka-server-common -> file:/home/ples/.gradle/caches/modules-2/files-2.1/org.apache.kafka/kafka-server-common/3.6.1/4895f6df5be60ec4aba3a006c9e75f159ca3abe2/kafka-server-common-3.6.1.jar, cannot set to file:/home/ples/.gradle/caches/modules-2/files-2.1/org.apache.kafka/kafka-server-common/3.6.1/dfd281eed4ceeb9131fa0a9bb1ff315cc4b802f7/kafka-server-common-3.6.1-test.jar
	at org.opensearch.bootstrap.Security.readPolicy(Security.java:249)
	at org.opensearch.bootstrap.BootstrapForTesting.<clinit>(BootstrapForTesting.java:165)
	... 4 more

How can one reproduce the bug?
Create any test which extends OpenSearchTestCase

What is the expected behavior?
Such tests can be created and executed.

@willyborankin willyborankin added bug Something isn't working untriaged Require the attention of the repository maintainers and may need to be prioritized labels Feb 26, 2024
@willyborankin willyborankin changed the title [BUG] Defaut tests hiwch extend OpenSearchTestCase doesn't work [BUG] Defaut tests which extend OpenSearchTestCase doesn't work Feb 26, 2024
@derek-ho
Copy link
Collaborator

[Triage] Thanks for filing this issue! It seems that this is related to jar hell and this is definitely something we want to support in the security plugin. It seems that it may be related to kafka and seeing where it is being imported may be the root cause

@derek-ho derek-ho added triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable. and removed untriaged Require the attention of the repository maintainers and may need to be prioritized labels Feb 26, 2024
@willyborankin
Copy link
Collaborator Author

willyborankin commented Feb 27, 2024

The problem is on the OpenSearch side.

@willyborankin willyborankin changed the title [BUG] Defaut tests which extend OpenSearchTestCase doesn't work [BUG] Defaut tests which extend OpenSearchTestCase don't work Feb 29, 2024
@willyborankin
Copy link
Collaborator Author

Related issue in OpenSearch opensearch-project/OpenSearch#12581

@peternied
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable.
Projects
None yet
Development

No branches or pull requests

3 participants