Skip to content

Commit 7742566

Browse files
committedNov 28, 2023
fix test VThreadEventTest.java
1 parent 3582b32 commit 7742566

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed
 

‎test/hotspot/jtreg/serviceability/jvmti/vthread/VThreadEventTest/VThreadEventTest.java

+10-4
Original file line numberDiff line numberDiff line change
@@ -184,23 +184,29 @@ public static void main(String[] args) throws Exception {
184184
int threadEndExp = THREAD_CNT;
185185
int threadMountExp = THREAD_CNT - TCNT2;
186186
int threadUnmountExp = THREAD_CNT + TCNT3;
187+
int diffUnmountMountExp = TCNT2 + TCNT3;
187188

188189
log("ThreadEnd cnt: " + threadEndCnt + " (expected: " + threadEndExp + ")");
189-
log("ThreadMount cnt: " + threadMountCnt + " (expected: " + threadMountExp + ")");
190-
log("ThreadUnmount cnt: " + threadUnmountCnt + " (expected: " + threadUnmountExp + ")");
190+
log("ThreadMount cnt: " + threadMountCnt + " (expected: >=" + threadMountExp + ")");
191+
log("ThreadUnmount cnt: " + threadUnmountCnt + " (expected: >=" + threadUnmountExp + ")");
192+
log("ThreadUnmount/ThreadMount diff cnt: " + (threadUnmountCnt - threadMountCnt) + " (expected: " + diffUnmountMountExp + ")");
191193

192194
if (threadEndCnt != threadEndExp) {
193195
log("FAILED: unexpected count of ThreadEnd events");
194196
failed = true;
195197
}
196-
if (threadMountCnt != threadMountExp) {
198+
if (threadMountCnt < threadMountExp) {
197199
log("FAILED: unexpected count of ThreadMount events");
198200
failed = true;
199201
}
200-
if (threadUnmountCnt != threadUnmountExp) {
202+
if (threadUnmountCnt < threadUnmountExp) {
201203
log("FAILED: unexpected count of ThreadUnmount events");
202204
failed = true;
203205
}
206+
if ((threadUnmountCnt - threadMountCnt) != diffUnmountMountExp) {
207+
log("FAILED: unexpected difference of ThreadUnmount and threadMountCnt events");
208+
failed = true;
209+
}
204210
if (failed) {
205211
throw new RuntimeException("FAILED: event count is wrong");
206212
}

0 commit comments

Comments
 (0)
Please sign in to comment.