Re: RFR: 8286788: Test java/lang/Thread/virtual/ThreadAPI.testGetStackTrace3 fails

2022-05-17 Thread Jaikiran Pai
On Tue, 17 May 2022 11:15:19 GMT, Alan Bateman  wrote:

> This is a test fix. ThreadAPI.testGetStackTrace3 tests Thread::getStackTrace 
> on a thread doing a selection operation. The test is not reliable as it 
> expects to see the "select" method in the stack trace after waiting 200ms. 
> The test is changed to poll the stack trace so that it's no longer dependent 
> on sleep.
> 
> The update includes a drive-by change to the test description to use 
> `@enablePreview`.

Looks fine to me.

The documentation of `@enablePreview` states:
> If a test declares that it uses preview features, these additional options 
> will be provided automatically, for all @run main and @compile actions, 
> including implicit @compile actions generated by @build actions.

The test here is using `testng` and not `main`, but I think it's more a 
documentation issue since it appears that the test is running fine in GitHub 
Actions job:


2022-05-17T12:12:50.5073267Z TEST: java/lang/Thread/virtual/ThreadAPI.java
2022-05-17T12:12:50.5073898Z   build: 0.138 seconds
2022-05-17T12:12:50.5074531Z   compile: 0.138 seconds
2022-05-17T12:12:50.5074992Z   testng: 32.421 seconds
2022-05-17T12:12:50.5076274Z TEST RESULT: Passed. Execution successful
2022-05-17T12:12:50.5076900Z

-

Marked as reviewed by jpai (Committer).

PR: https://git.openjdk.java.net/jdk/pull/8743


Re: RFR: 8286788: Test java/lang/Thread/virtual/ThreadAPI.testGetStackTrace3 fails

2022-05-17 Thread Joe Darcy
On Tue, 17 May 2022 11:15:19 GMT, Alan Bateman  wrote:

> This is a test fix. ThreadAPI.testGetStackTrace3 tests Thread::getStackTrace 
> on a thread doing a selection operation. The test is not reliable as it 
> expects to see the "select" method in the stack trace after waiting 200ms. 
> The test is changed to poll the stack trace so that it's no longer dependent 
> on sleep.
> 
> The update includes a drive-by change to the test description to use 
> `@enablePreview`.

Marked as reviewed by darcy (Reviewer).

test/jdk/java/lang/Thread/virtual/ThreadAPI.java line 28:

> 26:  * @bug 8284161 8286788
> 27:  * @summary Test Thread API with virtual threads
> 28:  * @enablePreview

Good to see there is directed jtreg support for this.

-

PR: https://git.openjdk.java.net/jdk/pull/8743


RFR: 8286788: Test java/lang/Thread/virtual/ThreadAPI.testGetStackTrace3 fails

2022-05-17 Thread Alan Bateman
This is a test fix. ThreadAPI.testGetStackTrace3 tests Thread::getStackTrace on 
a thread doing a selection operation. The test is not reliable as it expects to 
see the "select" method in the stack trace after waiting 200ms. The test is 
changed to poll the stack trace so that it's no longer dependent on sleep.

The update includes a drive-by change to the test description to use 
`@enablePreview`.

-

Commit messages:
 - Initial commit

Changes: https://git.openjdk.java.net/jdk/pull/8743/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=8743=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8286788
  Stats: 10 lines in 1 file changed: 3 ins; 2 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8743.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8743/head:pull/8743

PR: https://git.openjdk.java.net/jdk/pull/8743