You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/04/14 19:21:22 UTC

[GitHub] [geode] BalaKaza opened a new pull request, #7592: GEODE-10223: Fix BlockingCommandListnerTest to be less flaky.

BalaKaza opened a new pull request, #7592:
URL: https://github.com/apache/geode/pull/7592

   testTimeoutIsAdjusted is flaky on windows machines. This will fix it to
   be less flaky.
   
   Authored-by: Bala Kaza Venkata <bk...@vmware.com>
   
   <!-- Thank you for submitting a contribution to Apache Geode. -->
   
   <!-- In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken: 
   -->
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [ ] Does `gradlew build` run cleanly?
   
   - [ ] Have you written or updated unit tests to verify your changes?
   
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   <!-- Note:
   Please ensure that once the PR is submitted, check Concourse for build issues and
   submit an update to your PR as soon as possible. If you need help, please send an
   email to dev@geode.apache.org.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [geode] jdeppe-pivotal commented on a diff in pull request #7592: GEODE-10223: Fix BlockingCommandListnerTest to be less flaky.

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal commented on code in PR #7592:
URL: https://github.com/apache/geode/pull/7592#discussion_r850778592


##########
geode-for-redis/src/integrationTest/java/org/apache/geode/redis/internal/eventing/BlockingCommandListenerTest.java:
##########
@@ -58,7 +58,7 @@ public void testTimeoutIsAdjusted() {
     verify(context, times(1)).resubmitCommand(argumentCaptor.capture());
 
     double timeout = Coder.bytesToDouble(argumentCaptor.getValue().getCommandArguments().get(0));
-    assertThat(timeout).isLessThan(1.0D);
+    await().untilAsserted(() -> assertThat(timeout).isLessThan(1.0D));

Review Comment:
   Since `timeout` is only calculated once, this await will not do what you want. I think you're better off just putting a sleep before the `resubmitCommand()` call. The test is flaky on Windows where the resolution of the clock is not very high (I believe the clock only ticks every 15ms) so it could be that this could runs quickly enough that the timeout does not get recalculated with an updated clock time.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [geode] ringles merged pull request #7592: GEODE-10223: Fix BlockingCommandListnerTest to be less flaky.

Posted by GitBox <gi...@apache.org>.
ringles merged PR #7592:
URL: https://github.com/apache/geode/pull/7592


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [geode] BalaKaza commented on a diff in pull request #7592: GEODE-10223: Fix BlockingCommandListnerTest to be less flaky.

Posted by GitBox <gi...@apache.org>.
BalaKaza commented on code in PR #7592:
URL: https://github.com/apache/geode/pull/7592#discussion_r850852919


##########
geode-for-redis/src/integrationTest/java/org/apache/geode/redis/internal/eventing/BlockingCommandListenerTest.java:
##########
@@ -58,7 +58,7 @@ public void testTimeoutIsAdjusted() {
     verify(context, times(1)).resubmitCommand(argumentCaptor.capture());
 
     double timeout = Coder.bytesToDouble(argumentCaptor.getValue().getCommandArguments().get(0));
-    assertThat(timeout).isLessThan(1.0D);
+    await().untilAsserted(() -> assertThat(timeout).isLessThan(1.0D));

Review Comment:
   Ah. Interesting point. Yeah, we could try this. At this point as we cannot reproduce this bug. So we can start with this approach and see.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [geode] jdeppe-pivotal commented on a diff in pull request #7592: GEODE-10223: Fix BlockingCommandListnerTest to be less flaky.

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal commented on code in PR #7592:
URL: https://github.com/apache/geode/pull/7592#discussion_r850778592


##########
geode-for-redis/src/integrationTest/java/org/apache/geode/redis/internal/eventing/BlockingCommandListenerTest.java:
##########
@@ -58,7 +58,7 @@ public void testTimeoutIsAdjusted() {
     verify(context, times(1)).resubmitCommand(argumentCaptor.capture());
 
     double timeout = Coder.bytesToDouble(argumentCaptor.getValue().getCommandArguments().get(0));
-    assertThat(timeout).isLessThan(1.0D);
+    await().untilAsserted(() -> assertThat(timeout).isLessThan(1.0D));

Review Comment:
   Since `timeout` is only calculated once, this await will not do what you want. I think you're better off just putting a sleep before the `resubmitCommand()` call.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [geode] BalaKaza commented on a diff in pull request #7592: GEODE-10223: Fix BlockingCommandListnerTest to be less flaky.

Posted by GitBox <gi...@apache.org>.
BalaKaza commented on code in PR #7592:
URL: https://github.com/apache/geode/pull/7592#discussion_r850852919


##########
geode-for-redis/src/integrationTest/java/org/apache/geode/redis/internal/eventing/BlockingCommandListenerTest.java:
##########
@@ -58,7 +58,7 @@ public void testTimeoutIsAdjusted() {
     verify(context, times(1)).resubmitCommand(argumentCaptor.capture());
 
     double timeout = Coder.bytesToDouble(argumentCaptor.getValue().getCommandArguments().get(0));
-    assertThat(timeout).isLessThan(1.0D);
+    await().untilAsserted(() -> assertThat(timeout).isLessThan(1.0D));

Review Comment:
   Ah. Interesting point. Yeah, we could try this. At this point as we cannot reproduce we can start with this approach and see.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [geode] jdeppe-pivotal commented on a diff in pull request #7592: GEODE-10223: Fix BlockingCommandListnerTest to be less flaky.

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal commented on code in PR #7592:
URL: https://github.com/apache/geode/pull/7592#discussion_r850778592


##########
geode-for-redis/src/integrationTest/java/org/apache/geode/redis/internal/eventing/BlockingCommandListenerTest.java:
##########
@@ -58,7 +58,7 @@ public void testTimeoutIsAdjusted() {
     verify(context, times(1)).resubmitCommand(argumentCaptor.capture());
 
     double timeout = Coder.bytesToDouble(argumentCaptor.getValue().getCommandArguments().get(0));
-    assertThat(timeout).isLessThan(1.0D);
+    await().untilAsserted(() -> assertThat(timeout).isLessThan(1.0D));

Review Comment:
   Since `timeout` is only calculated once, this await will not do what you want. I think you're better off just putting a sleep before the `resubmitCommand()` call. The test is flaky on Windows where the resolution of the clock is not very high (I believe the clock only ticks every 15ms) so it could be that this runs quickly enough that the timeout does not get recalculated with an updated clock time.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [geode] ezoerner commented on pull request #7592: GEODE-10223: Fix BlockingCommandListnerTest to be less flaky.

Posted by GitBox <gi...@apache.org>.
ezoerner commented on PR #7592:
URL: https://github.com/apache/geode/pull/7592#issuecomment-1099575624

   LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org