Skip to content
This repository was archived by the owner on Nov 11, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public Void apply(Iterable<KV<Integer, Integer>> input) {
values.add(kv.getValue());
}
if (timeBound) {
assertTrue(values.size() > 2);
assertTrue(values.size() >= 1);
} else if (dedup) {
// Verify that at least some data came through. The chance of 90% of the input
// being duplicates is essentially zero.
Expand All @@ -111,7 +111,7 @@ public Void apply(Iterable<KV<Integer, Integer>> input) {
Collections.sort(values);
for (int i = 0; i < values.size(); i++) {
assertEquals(i, (int) values.get(i));
}
}
if (finalizeTracker != null) {
assertThat(finalizeTracker, containsInAnyOrder(values.size() - 1));
}
Expand All @@ -126,7 +126,7 @@ private void test(boolean dedup, boolean timeBound) throws Exception {
finalizeTracker = new ArrayList<>();
TestCountingSource.setFinalizeTracker(finalizeTracker);
}
TestCountingSource source = new TestCountingSource(Integer.MAX_VALUE);
TestCountingSource source = new TestCountingSource(Integer.MAX_VALUE).withoutSplitting();
if (dedup) {
source = source.withDedup();
}
Expand All @@ -135,11 +135,6 @@ private void test(boolean dedup, boolean timeBound) throws Exception {
? p.apply(Read.from(source).withMaxReadTime(Duration.millis(200)))
: p.apply(Read.from(source).withMaxNumRecords(NUM_RECORDS));

List<KV<Integer, Integer>> expectedOutput = new ArrayList<>();
for (int i = 0; i < NUM_RECORDS; i++) {
expectedOutput.add(KV.of(0, i));
}

// Because some of the NUM_RECORDS elements read are dupes, the final output
// will only have output from 0 to n where n < NUM_RECORDS.
DataflowAssert.that(output).satisfies(new Checker(dedup, timeBound));
Expand Down