aIbrahiim commented on code in PR #38753:
URL: https://github.com/apache/beam/pull/38753#discussion_r3332818566


##########
runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/TestDataflowRunner.java:
##########
@@ -121,19 +121,28 @@ DataflowPipelineJob run(Pipeline pipeline, DataflowRunner 
runner) {
     ErrorMonitorMessagesHandler messageHandler =
         new ErrorMonitorMessagesHandler(job, new 
MonitoringUtil.LoggingHandler());
 
+    java.util.concurrent.atomic.AtomicReference<Optional<Boolean>> 
assertionsPassedRef =
+        new java.util.concurrent.atomic.AtomicReference<>(Optional.absent());
+
     if (options.isStreaming()) {
       if (options.isBlockOnRun()) {
-        jobSuccess = waitForStreamingJobTermination(job, messageHandler);
+        jobSuccess = waitForStreamingJobTermination(job, messageHandler, 
assertionsPassedRef);
       } else {
         jobSuccess = true;
       }
-      // No metrics in streaming
-      allAssertionsPassed = Optional.absent();
+      allAssertionsPassed = assertionsPassedRef.get();
+      if (!allAssertionsPassed.isPresent()) {
+        allAssertionsPassed = checkForPAssertSuccess(job);
+      }
     } else {
       jobSuccess = waitForBatchJobTermination(job, messageHandler);
       allAssertionsPassed = checkForPAssertSuccess(job);
     }
 
+    if (allAssertionsPassed.isPresent() && allAssertionsPassed.get()) {
+      jobSuccess = true;

Review Comment:
   here forcing jobSuccess = true when streaming PAssert metrics report success 
even if the job state is CANCELLED, can you confirm that won’t mask non 
assertion failures?



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