Skip to content

Commit

Permalink
Adding a test case that verifies runner-managed sharding for DirectRu…
Browse files Browse the repository at this point in the history
…nner
  • Loading branch information
pabloem committed Aug 31, 2023
1 parent 913f000 commit 924a325
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,22 @@ public void testWindowedWritesWithOnceTrigger() throws Throwable {
.apply(Values.create());
}

@Test
@Category(NeedsRunner.class)
public void testWindowedWritesWithStreamingRunnerDeterminedSharding() throws Throwable {
PCollection<String> data =
p.apply(
TestStream.create(StringUtf8Coder.of())
.addElements("0", "1", "2")
.advanceWatermarkToInfinity())
.apply(Window.<String>into(FixedWindows.of(Duration.standardSeconds(1))));
data.apply(
TextIO.write()
.to(new File(tempFolder.getRoot(), "windowed-writes-noshards").getAbsolutePath())
.withWindowedWrites());
p.run().waitUntilFinish();
}

@Test
@Category(NeedsRunner.class)
public void testWriteViaSink() throws Exception {
Expand Down

0 comments on commit 924a325

Please sign in to comment.