Skip to content

Commit d9d5e93

Browse files
authored
[ISSUE #9177] Fix unstable tests in AdaptiveLockTest.testAdaptiveLock (#9178)
1 parent 6148b89 commit d9d5e93

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

store/src/test/java/org/apache/rocketmq/store/lock/AdaptiveLockTest.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,11 @@ public void run() {
7878
}
7979
assertTrue(adaptiveLock.getAdaptiveLock() instanceof BackOffReentrantLock);
8080

81-
adaptiveLock.lock();
82-
Thread.sleep(1000);
83-
adaptiveLock.unlock();
81+
for (int i = 0; i <= 2; i++) {
82+
adaptiveLock.lock();
83+
adaptiveLock.unlock();
84+
Thread.sleep(1000);
85+
}
8486
assertTrue(adaptiveLock.getAdaptiveLock() instanceof BackOffSpinLock);
8587
}
8688
}

0 commit comments

Comments
 (0)