Skip to content

Commit 66745c8

Browse files
committed
[FLUSS-1855][server] Updated Clarity for TimerTaskEntry Null-Safety Test
1 parent 0edf1b3 commit 66745c8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

fluss-server/src/test/java/org/apache/fluss/server/utils/timer/TimerTaskEntryTest.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,20 @@ void testRemoveEnsuresCurrentListNullSafety() throws InterruptedException {
7575
try {
7676
// Wait for the initial removal to complete
7777
latch.await();
78-
// Add the entry from our separate list while the removal thread is
78+
// Add the entry to our separate list while the removal thread is
7979
// still verifying the condition (resulting in our null list within
8080
// the internal removal call, and our exception)
8181
for (int i = 0; i < 10000; i++) {
8282
// Determine which list to add to the task
8383
// (backwards-oscillation)
84-
if (entry.list == null) {
84+
TimerTaskList currentList = entry.list;
85+
if (currentList == null || currentList == primaryList) {
86+
// If the entry is not in any list or in the primary list,
87+
// move it to the secondary list
8588
secondaryList.add(entry);
86-
} else if (entry.list == secondaryList) {
89+
} else if (currentList == secondaryList) {
90+
// If the entry is in the secondary list, move it to the
91+
// primary list
8792
primaryList.add(entry);
8893
}
8994
Thread.yield();

0 commit comments

Comments
 (0)