You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ri...@apache.org on 2022/04/15 14:49:38 UTC

[geode] branch develop updated: GEODE-10223: Fix BlockingCommandListnerTest to be less flaky. (#7592)

This is an automated email from the ASF dual-hosted git repository.

ringles pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 9faaf49189 GEODE-10223: Fix BlockingCommandListnerTest to be less flaky. (#7592)
9faaf49189 is described below

commit 9faaf49189c32417d4cdea789a8888ede2daca39
Author: Bala Kaza Venkata <43...@users.noreply.github.com>
AuthorDate: Fri Apr 15 10:49:32 2022 -0400

    GEODE-10223: Fix BlockingCommandListnerTest to be less flaky. (#7592)
    
    * GEODE-10223: Fix BlockingCommandListnerTest to be less flaky.
    
    testTimeoutIsAdjusted is flaky on windows machines. Adding a delay will make it less flaky.
    
    Authored-by: Bala Kaza Venkata <bk...@vmware.com>
---
 .../geode/redis/internal/eventing/BlockingCommandListenerTest.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/geode-for-redis/src/integrationTest/java/org/apache/geode/redis/internal/eventing/BlockingCommandListenerTest.java b/geode-for-redis/src/integrationTest/java/org/apache/geode/redis/internal/eventing/BlockingCommandListenerTest.java
index a984fc606f..5d64cf7585 100644
--- a/geode-for-redis/src/integrationTest/java/org/apache/geode/redis/internal/eventing/BlockingCommandListenerTest.java
+++ b/geode-for-redis/src/integrationTest/java/org/apache/geode/redis/internal/eventing/BlockingCommandListenerTest.java
@@ -15,6 +15,7 @@
 
 package org.apache.geode.redis.internal.eventing;
 
+import static java.lang.Thread.sleep;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
@@ -45,13 +46,13 @@ import org.apache.geode.redis.internal.netty.ExecutionHandlerContext;
 public class BlockingCommandListenerTest {
 
   @Test
-  public void testTimeoutIsAdjusted() {
+  public void testTimeoutIsAdjusted() throws InterruptedException {
     ExecutionHandlerContext context = mock(ExecutionHandlerContext.class);
     List<byte[]> commandArgs = Arrays.asList("KEY".getBytes(), "0".getBytes());
     Command command = new Command(RedisCommandType.BLPOP, commandArgs);
     BlockingCommandListener listener =
         new BlockingCommandListener(context, command, Collections.emptyList(), 1.0D);
-
+    sleep(100);
     listener.resubmitCommand();
 
     ArgumentCaptor<Command> argumentCaptor = ArgumentCaptor.forClass(Command.class);