Skip to content

Commit

Permalink
[Misc] fix TestPreemptWisp2InternalBug.java intermittently fail
Browse files Browse the repository at this point in the history
Summary: fix com/alibaba/wisp2/exclusive/bug/TestPreemptWisp2InternalBug.java intermittently fail, run 4 times in a test, if 2 times or more can not match the expect message, then the test is fail.

Test Plan: CI pipeline

Reviewed-by: yunyao.zxl, lei.yul

Issue: #313
  • Loading branch information
sendaoYan committed Oct 9, 2022
1 parent 4d7dbb8 commit 359c2eb
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,20 @@ public static void main(String[] args) throws Exception {
"-XX:+UseWisp2", "-XX:+UnlockDiagnosticVMOptions", "-XX:+VerboseWisp", "-XX:-Inline",
"--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
TestPreemptWisp2InternalBug.class.getName(), tasks[i]);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("[WISP] preempt was blocked, because wisp internal method on the stack");
}
int count = 0;
for (int j = 0; j < 4; j++) {
try {
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("[WISP] preempt was blocked, because wisp internal method on the stack");
break;
} catch (java.lang.RuntimeException e) {
count++;
}
}
if(count >= 2) {
throw new RuntimeException("Test " + tasks[i] + "run 5 times, failed " + count + " times!");
}
}
return;
}

Expand Down

0 comments on commit 359c2eb

Please sign in to comment.