Abacn commented on code in PR #30073:
URL: https://github.com/apache/beam/pull/30073#discussion_r1463499900


##########
sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/healthcare/DicomIOReadIT.java:
##########
@@ -90,4 +94,29 @@ public void testDicomMetadataRead() throws IOException {
       // noop - if runner does not support job.cancel()
     }
   }
+
+  @Test
+  public void testDicomFailedMetadataRead() throws IOException {
+    String badWebPath = "foo";
+
+    DicomIO.ReadStudyMetadata.Result result =
+        
pipeline.apply(Create.of(badWebPath)).apply(DicomIO.readStudyMetadata());
+
+    PAssert.that(result.getReadResponse()).empty();
+
+    PAssert.that(result.getFailedReads())
+        .satisfies(
+            (errors) -> {
+              Assert.assertTrue(errors.iterator().hasNext());
+              return null;
+            });
+
+    PipelineResult job = pipeline.run();
+
+    try {
+      job.cancel();

Review Comment:
   I was confused here in both tests. `job.cancel()` immediately after 
pipeline.run(). pipeline is a TestPipeline so `pipeline.run()` is a blocking 
call until the pipeline finished. What was the purpose of having `job.cancel()` 
here?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to