RFR: 8307968: serviceability/jvmti/vthread/StopThreadTest/StopThreadTest.java timed out [v2]
Leonid Mesnik
lmesnik at openjdk.org
Tue May 16 02:04:45 UTC 2023
On Tue, 16 May 2023 01:23:41 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:
>> This is newly integrated test times out because it has a race in in the Test #A.1 and #A.2.
>> The main root cause is a print statement which can case target virtual thread to unpark and unmount.
>> This causes that the `StopThreads` unexpectedly fails with the `JVMTI_ERROR_OPAQUE_FRAME` error code.
>> The target thread can be in some other unexpected states if JVMTI `StopThread`
>> is called before the target thread method `A()` reached the synchronized statement.
>>
>> The fix is to replace the `ensureStarted()` with the `ensureAtPointA()`.
>> The fix also includes some simplifications related to clearing the target thread interrupt status.
>>
>> Testing:
>> Hundreds of mach5 runs of `serviceability/jvmti/vthread` tests which include the fixed `StopThreadTest`.
>> TBD: To run mach5 tiers1-3.
>>
>> The test does not fail with this fix anymore.
>
> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
>
> moved Thread.interrupted() in StopThreadTest.java above a couple of lines
There is one nit related to code style.
test/hotspot/jtreg/serviceability/jvmti/vthread/StopThreadTest/StopThreadTest.java line 107:
> 105: testTaskThread = Thread.ofPlatform().name("TestTaskThread").start(testTask);
> 106: }
> 107: testTask.ensureAtPointA();
Java Code Conventions recommends to use className and not variables while calling static methods. Same for 'ensureFinished()'.
-------------
Marked as reviewed by lmesnik (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/13969#pullrequestreview-1427585186
PR Review Comment: https://git.openjdk.org/jdk/pull/13969#discussion_r1194518435
More information about the serviceability-dev
mailing list