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/12/28 19:43:51 UTC

[GitHub] [beam] ibzib commented on a change in pull request #16215: [BEAM-13402] Simplify PubsubLiteSink

ibzib commented on a change in pull request #16215:
URL: https://github.com/apache/beam/pull/16215#discussion_r776049548



##########
File path: sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/pubsublite/internal/PubsubLiteSinkTest.java
##########
@@ -207,32 +189,4 @@ public void exceptionMixedWithOK() throws Exception {
     assertThat(statusOr.get().code(), equalTo(Code.INTERNAL));
     exec.shutdownNow();
   }
-
-  @Test
-  public void listenerExceptionOnBundleFinish() throws Exception {
-    Message message1 = Message.builder().build();
-    SettableApiFuture<MessageMetadata> future = SettableApiFuture.create();
-
-    SettableApiFuture<Void> publishFuture = SettableApiFuture.create();
-    when(publisher.publish(message1))
-        .thenAnswer(
-            args -> {
-              publishFuture.set(null);
-              return future;
-            });
-    Future<?> executorFuture =
-        Executors.newSingleThreadExecutor()
-            .submit(
-                () -> {
-                  PipelineExecutionException e =
-                      assertThrows(PipelineExecutionException.class, () -> runWith(message1));
-                  Optional<CheckedApiException> statusOr = ExtractStatus.extract(e.getCause());
-                  assertTrue(statusOr.isPresent());
-                  assertThat(statusOr.get().code(), equalTo(Code.INTERNAL));
-                });
-    publishFuture.get();
-    listener.failed(null, new CheckedApiException(Code.INTERNAL).underlying);
-    future.set(MessageMetadata.of(Partition.of(1), Offset.of(2)));
-    executorFuture.get();
-  }

Review comment:
       > Yes, the publisher is managed by PublisherCache. When the publisher is failed, the publish() call will just throw, causing the bundle to be retried.
   
   Can we modify the test to mock PublisherCache etc. and check that behavior then, instead of deleting it?




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