-
Notifications
You must be signed in to change notification settings - Fork 39
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
TCK tests for virtual threads #425
TCK tests for virtual threads #425
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great Kyle! Thanks for writing this and demonstrating this approach to cover virtual=true in the TCK in a way that can be skipped on Java SE 17. I added a few minor comments - mostly on a typo of the word virtual that ended up copied to several places.
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virutal/VirtualFullTests.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virutal/VirtualFullTests.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virutal/VirtualFullTests.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virutal/VirtualThreadServlet.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virutal/VirtualThreadServlet.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virutal/VirtualThreadServlet.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virutal/VirtualWebTests.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virutal/VirtualWebTests.java
Outdated
Show resolved
Hide resolved
1804b4a
to
f4bcb3c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I noted one very minor type with two period characters (which might even be my fault if I mistyped my prior suggestion on that one). If you don't want to correct it, don't worry about it.
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virtual/VirtualWebTests.java
Outdated
Show resolved
Hide resolved
I don't think you should skip the testPlatformThreadFactory for Java 17. It should work same as Java 21. |
That will depend on the outcome of the vote that has yet to happen over what the behavior of virtual=true on Java SE 17 is. If vendor-specific wins, then we have no choice but to skip it because a vendor could choose to fail deployment. Kyle wrote this pull to investigate whether we would even be able to handle such an outcome, and did a very good job of figuring out a way. This pull will remain in pending state until a vote occurs and then be updated accordingly. |
I don't think you should fail the deployment when setting |
a857fb5
to
6c79fda
Compare
@njr-11 I think this needs a re-review now that it has been updated to comply with the results of the vote. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating this. I did spot some questionable assertions that are technically not guaranteed by the spec, although in most cases seem unlikely not to be the case.
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virtual/VirtualThreadServlet.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virtual/VirtualThreadServlet.java
Show resolved
Hide resolved
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virtual/VirtualThreadServlet.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virtual/VirtualThreadServlet.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virtual/VirtualThreadServlet.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virtual/VirtualThreadServlet.java
Outdated
Show resolved
Hide resolved
6c79fda
to
6e00848
Compare
@njr-11 I have handled all of the review comments you left. Please re-review when you get a chance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added suggestions for very minor corrections. Otherwise looks good. Thanks for writing these!
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virtual/VirtualThreadServlet.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virtual/VirtualThreadServlet.java
Show resolved
Hide resolved
tck/src/main/java/ee/jakarta/tck/concurrent/spec/Platform/virtual/VirtualThreadServlet.java
Outdated
Show resolved
Hide resolved
…ual/VirtualThreadServlet.java Co-authored-by: Nathan Rauh <nathan.rauh@us.ibm.com>
…ual/VirtualThreadServlet.java Co-authored-by: Nathan Rauh <nathan.rauh@us.ibm.com>
This PR has been opened for a while and there have been no other comments/reviews. Now that all the comments have been resolved I'll go ahead and merge this. |
These are tests for
virtual=true
assuming option 2 will win the vote (which is currently in the lead).When testing on Java 17:
virtual=false
andvirtual=true
configurationsvirtual=false
a platform thread is returned for ManagedExecutorService, ManagedExecutorScheduledService, ManagedThreadFactory, ForkJoinPool.virtual=true
a platform thread is returned for ManagedExecutorService, ManagedExecutorScheduledService, ManagedThreadFactory, ForkJoinPool.When testing on Java 21:
virtual=false
andvirtual=true
configurations.virtual=false
a platform thread is returned for ManagedExecutorService, ManagedExecutorScheduledService, ManagedThreadFactory, ForkJoinPool.virtual=true
a platform thread is returned for a ForkJoinPool backed by a ManagedThreadFactory as defined by Java.virtual=true
a virtual thread is returned for ManagedExecutorService, ManagedExecutorScheduledService, ManagedThreadFactory