RFR: 8262271: SA: Add new stress test that tests getting the stack trace of an active thread

Chris Plummer cjplummer at openjdk.java.net
Tue Mar 9 06:31:05 UTC 2021


On Tue, 9 Mar 2021 06:21:22 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> test/jdk/sun/tools/jhsdb/JStackStressTest.java line 91:
>> 
>>> 89:             } else {
>>> 90:                 System.out.println("Jshell not alive");
>>> 91:             }
>> 
>> Shouldn't we use `Process::waitFor` at this point to ensure the jshell is terminated? This test might not have enough time to shutdown since issuing `/exit`.
>> `destroy()` should be called when timeout is happened at `waitFor()`.
>
> Yeah, I'll do that. Not sure why I didn't do it that way in the first place. I think I copied this from somewhere, but now I can't find where.

Ah, it was JShellHeapDumpTest.java, which does the same thing (it's in a different test directory, so my grep missed it). There really is no reason not to just forcibly kill it, since its job is done and we don't really need its output or a graceful exit. However, for some reason I partially decided to try to get it to exit gracefully by adding the /exit command, and then get the output. So I'll still add the waitfor.

-------------

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


More information about the serviceability-dev mailing list