You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/09/20 18:03:42 UTC

[GitHub] [beam] ajamato commented on a change in pull request #15537: [BEAM-12908] Add a 10 second sleep to the IT after topic creation to wait for propagation

ajamato commented on a change in pull request #15537:
URL: https://github.com/apache/beam/pull/15537#discussion_r712396340



##########
File path: sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/pubsublite/ReadWriteIT.java
##########
@@ -236,6 +236,8 @@ public void testReadWrite() throws Exception {
     pipeline.getOptions().as(TestPipelineOptions.class).setBlockOnRun(false);
 
     TopicPath topic = createTopic(getProject(pipeline.getOptions()));
+    // Sleep for topic creation to propagate.
+    Thread.sleep(10000);

Review comment:
       Generally, its better to not add sleep to code like this, but rather some logic that checks if a condition is met.
   
   What if the sleep is not long enough in all situations?
   
   This seems like it would introduce flakey/incorrect behavior




-- 
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: github-unsubscribe@beam.apache.org

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