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

Verify VarHandle class initialization #4192

Merged
merged 1 commit into from
Jan 9, 2019

Conversation

JasonFengJ9
Copy link
Member

Verify VarHandle class initialization

When a static field hasn't been initialized implicitly and a VarHandle is created to access this field. The field has to be initialized before returning the value via the VarHandle.
This test verifies that a VarHandle returns correct field value when there is no implicit static field initialization.

close #3205
depends #3928

Without dependent PR, this test fails with following stacktrace:

FAILED: testFinalFieldInClassNotInitialized
java.lang.AssertionError: expected [1] but found [0]
	at org.testng.Assert.fail(Assert.java:96)
	at org.testng.Assert.failNotEquals(Assert.java:776)
	at org.testng.Assert.assertEqualsImpl(Assert.java:137)
	at org.testng.Assert.assertEquals(Assert.java:118)
	at org.testng.Assert.assertEquals(Assert.java:652)
	at org.testng.Assert.assertEquals(Assert.java:662)
	at org.openj9.test.varhandle.StaticFieldVarHandleTests.testFinalFieldInClassNotInitialized(StaticFieldVarHandleTests.java:2463)

Manually verified that this test and the test from #3205 pass with #3928.

Reviewer: @DanHeidinga
FYI: @llxia

Signed-off-by: Jason Feng fengj@ca.ibm.com

@DanHeidinga
Copy link
Member

@JasonFengJ9 Do the tests pass on the RI as well?

@DanHeidinga DanHeidinga self-requested a review January 8, 2019 13:40
@JasonFengJ9
Copy link
Member Author

@DanHeidinga yes, I verified that RI passes the standalone testcase (same code snippet as this PR).

@DanHeidinga
Copy link
Member

Jenkins test sanity zlinux jdk11

@DanHeidinga DanHeidinga self-assigned this Jan 8, 2019
@JasonFengJ9
Copy link
Member Author

@DanHeidinga the sanity build failure is a compilation error objs/compiler/z/runtime/Math.o.s:36: Error: junk at end of line, first unrecognized character is % which can't be caused by this PR.
I don't see such error in previous build, maybe try another build?

@DanHeidinga
Copy link
Member

Jenkins test sanity zlinux,xlinux jdk11

@JasonFengJ9
Copy link
Member Author

Same failure again, it also occurred in another PR build https://ci.eclipse.org/openj9/job/PullRequest-Sanity-JDK11-linux_390-64_cmprssptrs-OpenJ9/131/console, created #4206.
It is not related to this PR.

@JasonFengJ9
Copy link
Member Author

PullRequest-Sanity-JDK11-linux_x86-64_cmprssptrs-OpenJ9 JarExtensionsTests.BuildInitial2 probably is a machine issue, and is not related this PR.
#4204 is now merged and the compilation seems fine at https://ci.eclipse.org/openj9/job/PullRequest-Sanity-JDK11-linux_390-64_cmprssptrs-OpenJ9/132/.

@DanHeidinga could you start another PR build?

@pshipton
Copy link
Member

pshipton commented Jan 8, 2019

@JasonFengJ9 you need to rebase first.

When a static field hasn't been initialized implicitly and a VarHandle
is created to access this field. The field has to be initialized before
returning the value via the VarHandle.
This test verifies that a VarHandle returns correct field value when
there is no implicit static field initialization.

Signed-off-by: Jason Feng <fengj@ca.ibm.com>
@JasonFengJ9
Copy link
Member Author

@pshipton yeah, that's right, done.

@pshipton
Copy link
Member

pshipton commented Jan 8, 2019

Jenkins test sanity zlinux,xlinux jdk11

@DanHeidinga DanHeidinga merged commit ba36fc7 into eclipse-openj9:master Jan 9, 2019
@JasonFengJ9 JasonFengJ9 deleted the varhandletest branch February 19, 2019 15:43
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.

JTReg test fail : java/util/concurrent/LinkedTransferQueue/WhiteBox.java
3 participants