kennknowles commented on code in PR #25976:
URL: https://github.com/apache/beam/pull/25976#discussion_r1167243706


##########
sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/ViewTest.java:
##########
@@ -247,11 +244,87 @@ public void processElement(ProcessContext c) {
                 })
             .withSideInputs(view));
 
-    thrown.expect(PipelineExecutionException.class);
-    thrown.expectCause(isA(IllegalArgumentException.class));
-    thrown.expectMessage("PCollection");
-    thrown.expectMessage("more than one");
-    thrown.expectMessage("singleton");
+    // As long as we get an error, be flexible with how a runner surfaces it
+    thrown.expect(Exception.class);
+
+    pipeline.run();
+  }
+
+  @Test
+  @Category(ValidatesRunner.class)
+  public void testDiscardingNonSingletonSideInput() throws Exception {
+
+    PCollection<Integer> oneTwoThree = pipeline.apply(Create.of(1, 2, 3));
+    final PCollectionView<Integer> view =
+        oneTwoThree
+            .apply(Window.<Integer>configure().discardingFiredPanes())
+            .apply(View.asSingleton());
+
+    oneTwoThree.apply(
+        "OutputSideInputs",
+        ParDo.of(
+                new DoFn<Integer, Integer>() {
+                  @ProcessElement
+                  public void processElement(ProcessContext c) {
+                    c.output(c.sideInput(view));
+                  }
+                })
+            .withSideInputs(view));
+
+    // As long as we get an error, be flexible with how a runner surfaces it
+    thrown.expect(Exception.class);
+
+    pipeline.run();
+  }
+
+  @Test
+  @Category(ValidatesRunner.class)
+  public void testTriggeredLatestSingleton() {

Review Comment:
   @reuvenlax @rezarokni did I mess up the test? fails on dataflow v1



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