Skip to content

Commit 877f111

Browse files
committed
Remove tests wrongly asserting that reiteration is still cached.
1 parent 6b8ef13 commit 877f111

File tree

1 file changed

+0
-70
lines changed

1 file changed

+0
-70
lines changed

sdks/java/harness/src/test/java/org/apache/beam/fn/harness/state/StateBackedIterableTest.java

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import java.util.Iterator;
3333
import java.util.List;
3434
import java.util.Random;
35-
import org.apache.beam.fn.harness.Cache;
3635
import org.apache.beam.fn.harness.Caches;
3736
import org.apache.beam.model.fnexecution.v1.BeamFnApi.StateKey;
3837
import org.apache.beam.sdk.coders.StringUtf8Coder;
@@ -111,75 +110,6 @@ public void testReiteration() throws Exception {
111110
assertEquals(expected, Lists.newArrayList(iterable));
112111
}
113112

114-
@Test
115-
public void testReiterationCached() throws Exception {
116-
FakeBeamFnStateClient fakeBeamFnStateClient =
117-
new FakeBeamFnStateClient(
118-
StringUtf8Coder.of(),
119-
ImmutableMap.of(
120-
key("nonEmptySuffix"), asList("C", "D", "E", "F", "G", "H", "I", "J", "K"),
121-
key("emptySuffix"), asList()));
122-
123-
StateBackedIterable<String> iterable =
124-
new StateBackedIterable<>(
125-
Caches.eternal(),
126-
fakeBeamFnStateClient,
127-
"instruction",
128-
key(suffixKey),
129-
StringUtf8Coder.of(),
130-
prefix);
131-
132-
// Ensure that the load is lazy
133-
assertEquals(0, fakeBeamFnStateClient.getCallCount());
134-
assertEquals(expected, Lists.newArrayList(iterable));
135-
// We expect future reiterations to not perform any loads
136-
int callCount = fakeBeamFnStateClient.getCallCount();
137-
assertEquals(expected, Lists.newArrayList(iterable));
138-
assertEquals(expected, Lists.newArrayList(iterable));
139-
assertEquals(callCount, fakeBeamFnStateClient.getCallCount());
140-
}
141-
142-
@Test
143-
public void testCacheKeyIsUnique() throws Exception {
144-
// Share a cache for multiple iterables leads to distinct keys being used.
145-
Cache cache = Caches.eternal();
146-
FakeBeamFnStateClient fakeBeamFnStateClient =
147-
new FakeBeamFnStateClient(
148-
StringUtf8Coder.of(),
149-
ImmutableMap.of(
150-
key("nonEmptySuffix"), asList("C", "D", "E", "F", "G", "H", "I", "J", "K"),
151-
key("emptySuffix"), asList(),
152-
key("otherIterable"), asList("Z")));
153-
154-
StateBackedIterable<String> otherIterable =
155-
new StateBackedIterable<>(
156-
cache,
157-
fakeBeamFnStateClient,
158-
"instruction",
159-
key("otherIterable"),
160-
StringUtf8Coder.of(),
161-
Collections.emptyList());
162-
// Ensure that the load is lazy
163-
assertEquals(0, fakeBeamFnStateClient.getCallCount());
164-
assertEquals(asList("Z"), Lists.newArrayList(otherIterable));
165-
166-
StateBackedIterable<String> iterable =
167-
new StateBackedIterable<>(
168-
cache,
169-
fakeBeamFnStateClient,
170-
"instruction",
171-
key(suffixKey),
172-
StringUtf8Coder.of(),
173-
prefix);
174-
175-
assertEquals(expected, Lists.newArrayList(iterable));
176-
// We expect future reiterations to not perform any loads
177-
int callCount = fakeBeamFnStateClient.getCallCount();
178-
assertEquals(expected, Lists.newArrayList(iterable));
179-
assertEquals(expected, Lists.newArrayList(iterable));
180-
assertEquals(callCount, fakeBeamFnStateClient.getCallCount());
181-
}
182-
183113
@Test
184114
public void testUsingInterleavedReiteration() throws Exception {
185115
FakeBeamFnStateClient fakeBeamFnStateClient =

0 commit comments

Comments
 (0)