Make loop infinite instead of counted so we get a core file if it fails.

This commit is contained in:
Coleen Phillimore 2026-08-03 19:39:29 +00:00
parent 73f23abe55
commit bcbb3bcc92

View File

@ -117,14 +117,13 @@ public class PrintRawMonitorLockTest {
OutputAnalyzer output = executor.execute("Thread.print -l=true");
if (!output.getOutput().contains("Found 1 deadlock")) {
// Execute dcmd in a loop in case the threads haven't deadlocked yet.
// Fail after 100 iterations. That's all it should take unless something is wrong.
for (int i = 0; i < 100; i++) {
// Execute dcmd in a timed loop in case the threads haven't deadlocked yet.
while (true) {
try {
Thread.sleep(100);
} catch (InterruptedException ie) {
}
// try again, otherwise java thinks it's not initialized.
// try again, otherwise java thinks output is not initialized.
output = executor.execute("Thread.print -l=true");
if (output.getOutput().contains("Found 1 deadlock")) {
break;