Skip to content

Commit

Permalink
Edit runStopsRetryingAfterTimeout test
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 committed May 21, 2023
1 parent 12b6bbc commit 8f068f1
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ protected void sleep(long ignored) {
public void runStopsRetryingAfterTimeout() {
ClusterConnectionProvider connectionHandler = mock(ClusterConnectionProvider.class);

final LongConsumer sleep = mock(LongConsumer.class);
//final LongConsumer sleep = mock(LongConsumer.class);
final AtomicLong totalSleepMs = new AtomicLong();
ClusterCommandExecutor testMe = new ClusterCommandExecutor(connectionHandler, 3, Duration.ZERO) {
@Override
public <T> T execute(Connection connection, CommandObject<T> commandObject) {
Expand All @@ -337,7 +338,8 @@ public <T> T execute(Connection connection, CommandObject<T> commandObject) {

@Override
protected void sleep(long sleepMillis) {
sleep.accept(sleepMillis);
//sleep.accept(sleepMillis);
totalSleepMs.addAndGet(sleepMillis);
}
};

Expand All @@ -347,8 +349,10 @@ protected void sleep(long sleepMillis) {
} catch (JedisClusterOperationException e) {
// expected
}
InOrder inOrder = inOrder(connectionHandler, sleep);
//InOrder inOrder = inOrder(connectionHandler, sleep);
InOrder inOrder = inOrder(connectionHandler);
inOrder.verify(connectionHandler).getConnection(STR_COM_OBJECT.getArguments());
inOrder.verifyNoMoreInteractions();
assertEquals(0L, totalSleepMs.get());
}
}

0 comments on commit 8f068f1

Please sign in to comment.