Skip to content

Commit

Permalink
Merge pull request #16730 from fengxue-IS/16722
Browse files Browse the repository at this point in the history
Add verbose output for VirtualThreadTests
  • Loading branch information
pshipton committed Feb 16, 2023
2 parents 386ee64 + 84a3fc4 commit 35c108f
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -179,6 +179,13 @@ public void test_YieldedVirtualThreadGetStackTrace() {
Thread.sleep(500);

StackTraceElement[] ste = t.getStackTrace();

// If stacktrace doesn't match expected result, print out stacktrace for debuggging.
if ((11 != ste.length) || !ste[0].getMethodName().equals("yieldImpl")) {
for (StackTraceElement st : ste) {
System.out.println(st);
}
}
AssertJUnit.assertTrue("Expected 11 frames, got " + ste.length, (11 == ste.length));
AssertJUnit.assertTrue("Expected top frame to be yieldImpl, got " + ste[0].getMethodName(), ste[0].getMethodName().equals("yieldImpl"));
LockSupport.unpark(t);
Expand Down

0 comments on commit 35c108f

Please sign in to comment.