Skip to content

Commit 58c46db

Browse files
committed
document asserts due to new state added
1 parent 5df8009 commit 58c46db

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

runners/flink/src/test/java/org/apache/beam/runners/flink/translation/wrappers/streaming/WindowDoFnOperatorTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ public void testTimerCleanupOfPendingTimerList() throws Exception {
156156
// Note that the following is 1 because the state is key-partitioned
157157
assertThat(Iterables.size(timerInternals.pendingTimersById.keys()), is(1));
158158

159+
// Expected 6 state entries:
160+
// - 2 entries for user buffer state ("buf") - one per key
161+
// - 2 entries for watermark hold state ("hold") - one per key
162+
// - 2 entries for non-empty panes count state ("count") - one per key
163+
// - additional 2 entries for "combinedMetadata" state if non default metadata will be added
159164
assertThat(testHarness.numKeyedStateEntries(), is(6));
160165
// close bundle
161166
testHarness.setProcessingTime(
@@ -169,6 +174,11 @@ public void testTimerCleanupOfPendingTimerList() throws Exception {
169174
// Note that the following is zero because we only the first key is active
170175
assertThat(Iterables.size(timerInternals.pendingTimersById.keys()), is(0));
171176

177+
// Expected 4 state entries remaining for the second key (which is still active):
178+
// - 1 entry for user buffer state ("buf")
179+
// - 1 entry for watermark hold state ("hold")
180+
// - 1 entry for non-empty panes count state ("count")
181+
// - 1 entry for "combinedMetadata" state if non default metadata will be added
172182
assertThat(testHarness.numKeyedStateEntries(), is(3));
173183

174184
// close bundle

0 commit comments

Comments
 (0)