Skip to content

Commit dcc9451

Browse files
committed
Fix.
1 parent 793b9ae commit dcc9451

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

eternalcode-commons-loom/test/com/eternalcode/commons/scheduler/loom/VirtualThreadExecutorTest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,17 @@ void submitRepeating_stopsAfterCancel() throws InterruptedException {
158158

159159
Thread.sleep(200);
160160
task.cancel();
161-
int countAfterCancel = count.get();
161+
int countSoonAfterCancel = count.get();
162162

163163
Thread.sleep(200);
164+
int countAfterSettle = count.get();
165+
assertTrue(
166+
countAfterSettle >= countSoonAfterCancel,
167+
"Count should not decrease after cancel");
164168

165-
assertEquals(countAfterCancel, count.get(), "Count should not increase after cancel");
169+
Thread.sleep(200);
170+
171+
assertEquals(countAfterSettle, count.get(), "Count should stabilize after cancel");
166172
}
167173

168174
@Test

0 commit comments

Comments
 (0)