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

Jaikiran Pai jpai at openjdk.java.net
Tue May 17 15:59:55 UTC 2022


On Tue, 17 May 2022 11:15:19 GMT, Alan Bateman <alanb at openjdk.org> 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


More information about the core-libs-dev mailing list