Skip to content

Commit 98fd98e

Browse files
committed
fixes leader election test failure: semophore miscount
Signed-off-by: yue9944882 <291271447@qq.com>
1 parent 3a5f893 commit 98fd98e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extended/src/test/java/io/kubernetes/client/extended/controller/LeaderElectingControllerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public void testLeaderElectingController() throws ApiException, InterruptedExcep
9999
mockController);
100100

101101
latch.acquire(2);
102-
controllerLatch.acquire(2);
102+
controllerLatch.acquire(1);
103103

104104
Thread controllerThread = new Thread(leaderElectingController::run);
105105
controllerThread.start();
@@ -109,7 +109,7 @@ public void testLeaderElectingController() throws ApiException, InterruptedExcep
109109
verify(mockLock, times(1)).create(any());
110110
verify(mockLock, atLeastOnce()).update(any());
111111

112-
controllerLatch.acquire(2);
112+
controllerLatch.acquire(1);
113113
verify(mockController, times(1)).run();
114114
verify(mockController, times(1)).shutdown();
115115
}

0 commit comments

Comments
 (0)