This is an automated email from the ASF dual-hosted git repository. lizhimin pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push: new d9d5e93135 [ISSUE #9177] Fix unstable tests in AdaptiveLockTest.testAdaptiveLock (#9178) d9d5e93135 is described below commit d9d5e931354fc13b7e5469aad5c0ad66869527e7 Author: hqbfz <125714719+3424672...@users.noreply.github.com> AuthorDate: Wed Feb 12 16:44:34 2025 +0800 [ISSUE #9177] Fix unstable tests in AdaptiveLockTest.testAdaptiveLock (#9178) --- .../java/org/apache/rocketmq/store/lock/AdaptiveLockTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/store/src/test/java/org/apache/rocketmq/store/lock/AdaptiveLockTest.java b/store/src/test/java/org/apache/rocketmq/store/lock/AdaptiveLockTest.java index ac1b3c60cc..c24a1dccae 100644 --- a/store/src/test/java/org/apache/rocketmq/store/lock/AdaptiveLockTest.java +++ b/store/src/test/java/org/apache/rocketmq/store/lock/AdaptiveLockTest.java @@ -78,9 +78,11 @@ public class AdaptiveLockTest { } assertTrue(adaptiveLock.getAdaptiveLock() instanceof BackOffReentrantLock); - adaptiveLock.lock(); - Thread.sleep(1000); - adaptiveLock.unlock(); + for (int i = 0; i <= 2; i++) { + adaptiveLock.lock(); + adaptiveLock.unlock(); + Thread.sleep(1000); + } assertTrue(adaptiveLock.getAdaptiveLock() instanceof BackOffSpinLock); } }