On Fri, 10 Jul 2026 04:10:15 GMT, Serguei Spitsyn <[email protected]> wrote:
>> Patricio Chilano Mateo has updated the pull request incrementally with two
>> additional commits since the last revision:
>>
>> - Updates in libStopThreadTest2.cpp
>> - More comments from David
>
> test/hotspot/jtreg/serviceability/jvmti/vthread/StopThreadTest2/StopThreadTest2.java
> line 27:
>
>> 25: * @test
>> 26: * @bug 8386116
>> 27: * @summary Test suspend and send async exception to a yielding virtual
>> thread
>
> Nits:
> - s/Test suspend and send async/Test suspending and sending async/
> - Also, it'd be better to add: `* @requires vm.jvmti` .
Added.
> test/hotspot/jtreg/serviceability/jvmti/vthread/StopThreadTest2/StopThreadTest2.java
> line 50:
>
>> 48: Thread.yield();
>> 49: }
>> 50: } catch (Throwable t) {}
>
> Nit: Ignoring the exception does not look good. Would it better, at least, to
> report the `Throwable` and related stack trace? Should the test fail in such
> cases? We may want to filter our the expected exception (triggered by the
> JVMTI `StopTread` and also verify if it was really thrown and fail otherwise.
> I'm not sure, my suggestions are correct but wanted to check on this with you.
I changed the code to catch the exception installed by `StopThread`
(`MyException` now) and increment a counter. Then on the main thread we check
that this counter matches the number of successfully installed async
exceptions. Let me know if you think that’s better.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31759#discussion_r3571967531
PR Review Comment: https://git.openjdk.org/jdk/pull/31759#discussion_r3571970240