Skip to content

Commit

Permalink
[ISSUE #9177] Fix unstable tests in AdaptiveLockTest.testAdaptiveLock (
Browse files Browse the repository at this point in the history
  • Loading branch information
3424672656 authored Feb 12, 2025
1 parent 6148b89 commit d9d5e93
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ public void run() {
}
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);
}
}

0 comments on commit d9d5e93

Please sign in to comment.