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/21 00:11:30 UTC

[GitHub] [beam] TheNeuralBit commented on a change in pull request #14734: [BEAM-12258] Re-throw exception from forked thread in PubsubTableProvideIT.testSQLLimit

TheNeuralBit commented on a change in pull request #14734:
URL: https://github.com/apache/beam/pull/14734#discussion_r712602589



##########
File path: sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/meta/provider/pubsub/PubsubTableProviderIT.java
##########
@@ -439,8 +440,20 @@ public void testSQLLimit() throws Exception {
                   return result.build();
                 });
 
-    eventsTopic.assertSubscriptionEventuallyCreated(
-        pipeline.getOptions().as(GcpOptions.class).getProject(), Duration.standardMinutes(5));
+    try {
+      eventsTopic.assertSubscriptionEventuallyCreated(
+          pipeline.getOptions().as(GcpOptions.class).getProject(), Duration.standardMinutes(5));
+    } catch (AssertionError assertionError) {
+      // If we timed out, check if the forked thread had an exception. If something
+      // did go wrong there this call will raise an ExecutionException, which we allow to bubble
+      // up.
+      try {
+        queryResult.get(1, TimeUnit.SECONDS);

Review comment:
       The timeout is for the case where no exception was raised on the forked thread, but we still didn't create a subscription for some reason. If we just call `get()` then we would hang indefinitely in that case. I changed the timeout to 0 seconds (which is maybe what you thought `get()` would do?), to make the intention more clear.
   
   




-- 
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