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

Separate tests that rely on SecurityManager (Jsr292) #14580

Merged
merged 1 commit into from
Apr 8, 2022

Conversation

EricYangIBM
Copy link
Contributor

SecurityManager will be removed in a future jdk. Separate tests that
rely on it so that they can be easily disabled in the future.

Issue: #14412
Signed-off-by: Eric Yang [email protected]

<javac srcdir="${srcpath}" excludes="${commonExcludes}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp">
<!-- exclude tests that depend on SecurityManager -->
<exclude name="com/ibm/j9/jsr292/MethodTypeTests_SM.java"/>
<exclude name="com/ibm/j9/jsr292/bootstrap/Test_CallerSensitive.java"/>
Copy link
Member

Choose a reason for hiding this comment

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

What error for this test? assuming it compiles even the security manager APIs are removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test_CallerSensitive depends on CallerSensitiveClass which extends SecurityManager

Copy link
Member

Choose a reason for hiding this comment

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

It doesn't appear that SecurityManager is required by CallerSensitiveClass, can the dependency be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried removing it and seems like it is ok

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Copyright (c) 2016, 2020 IBM Corp. and others
Copyright (c) 2016, 2022 IBM Corp. and others
Copy link
Member

Choose a reason for hiding this comment

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

This file has only copyright year change which is no needed.

<class name="com.ibm.j9.jsr292.MethodTypeTests_SM"/>
</classes>
</test>
</suite>
Copy link
Member

Choose a reason for hiding this comment

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

A new line is required at the end of a file.

@pshipton
Copy link
Member

pshipton commented Mar 3, 2022

jenkins test extended xlinux jdk8,jdk11,jdk17,jdk18,jdknext

@@ -89,8 +89,8 @@
--add-opens=java.base/java.lang=ALL-UNNAMED \
-Djava.security.policy=$(Q)$(TEST_RESROOT)$(D)java.policy$(Q) \
-cp $(Q)$(TEST_RESROOT)$(D)jsr292test.jar$(P)$(RESOURCES_DIR)$(P)$(TESTNG)$(P)$(LIB_DIR)$(D)asm-all.jar$(Q) \
org.testng.TestNG -d $(REPORTDIR) $(Q)$(TEST_RESROOT)$(D)testng.xml$(Q) \
-testnames jsr292Test,jsr292Test_optional \
org.testng.TestNG -d $(REPORTDIR) $(Q)$(TEST_RESROOT)$(D)testng_sm.xml$(Q) \
Copy link
Member

Choose a reason for hiding this comment

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

We don't support 9, 10 any more so this test can just be deleted.

<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of add -testnames jsr292Test_SM in different test targets , could we just have one jsr292Test_SM target? And add <version>8</version> and <variation>-Xjit:count=0</variation> in this jsr292Test_SM target? Did I miss anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems like jsr292Test_jdk8 and jsr292Test_jdk8_special are the same (with variation changes) but jsr292Test_JitCount0_jdk8 has an extra testname jsr292Test_optional and platform requirement ^arch.arm. The first two could probably be merged but why are they separate to begin with? If I merge the new SM tests then the non SM tests should be merged as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

The first two could probably be merged but why are they separate to begin with?

I am not sure the details, but I think these tests were added in the early days. And the test framework (TKG) might have limited ability back then, which resulted in separated targets.

If I merge the new SM tests then the non SM tests should be merged as well.

I was thinking to keep this PR simple and only deal with SM tests. And we can have a separate PR for cleaning up non SM tests later. But it is up to you. I am ok either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The github diff was messy when I tried to merge everything so I merged just the SM tests instead

SecurityManager will be removed in a future jdk. Separate tests that
rely on it so that they can be easily disabled in the future.

Issue: eclipse-openj9#14412
Signed-off-by: Eric Yang <[email protected]>
Copy link
Member

@JasonFengJ9 JasonFengJ9 left a comment

Choose a reason for hiding this comment

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

LGTM

@JasonFengJ9
Copy link
Member

@llxia ping

@llxia
Copy link
Contributor

llxia commented Apr 7, 2022

jenkins test extended xlinux jdk8,jdk11,jdk17,jdk18,jdknext

@llxia
Copy link
Contributor

llxia commented Apr 8, 2022

testSCCacheManagement_0 failure is a known issue #8949. Added comment #8949 (comment)

@llxia llxia merged commit 9f0377c into eclipse-openj9:master Apr 8, 2022
@EricYangIBM EricYangIBM deleted the sm_Jsr292 branch April 8, 2022 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants