Skip to content

Commit 00bf791

Browse files
committed
Fix flakiness in tests by increasing timeout and changing windowing type.
1 parent fa9d190 commit 00bf791

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/changestreams/it/SpannerChangeStreamOrderedWithinKeyGloballyIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public void testOrderedWithinKey() {
9999
.withDatabaseId(databaseId);
100100

101101
// Get the time increment interval at which to flush data changes ordered by key.
102-
final long timeIncrementInSeconds = 2;
102+
final long timeIncrementInSeconds = 10;
103103

104104
// Commit a initial transaction to get the timestamp to start reading from.
105105
List<Mutation> mutations = new ArrayList<>();

sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/changestreams/it/SpannerChangeStreamOrderedWithinKeyIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import org.apache.beam.sdk.transforms.DoFn;
4141
import org.apache.beam.sdk.transforms.GroupByKey;
4242
import org.apache.beam.sdk.transforms.ParDo;
43-
import org.apache.beam.sdk.transforms.windowing.FixedWindows;
43+
import org.apache.beam.sdk.transforms.windowing.Sessions;
4444
import org.apache.beam.sdk.transforms.windowing.Window;
4545
import org.apache.beam.sdk.values.KV;
4646
import org.apache.beam.sdk.values.PCollection;
@@ -113,7 +113,7 @@ public void testOrderedWithinKey() {
113113
.apply(ParDo.of(new BreakRecordByModFn()))
114114
.apply(ParDo.of(new KeyByIdFn()))
115115
.apply(ParDo.of(new KeyValueByCommitTimestampAndRecordSequenceFn<>()))
116-
.apply(Window.into(FixedWindows.of(Duration.standardMinutes(2))))
116+
.apply(Window.into(Sessions.withGapDuration(Duration.standardMinutes(2))))
117117
.apply(GroupByKey.create())
118118
.apply(ParDo.of(new ToStringFn()));
119119

0 commit comments

Comments
 (0)