jeqo commented on a change in pull request #10293: URL: https://github.com/apache/kafka/pull/10293#discussion_r592620749
########## File path: streams/src/test/java/org/apache/kafka/streams/state/internals/AbstractWindowBytesStoreTest.java ########## @@ -710,73 +710,9 @@ public void testPutAndFetchAfter() { assertNull(entriesByKey.get(6)); } - @Test - @SuppressWarnings("deprecation") - public void testPutSameKeyTimestamp() { - windowStore = buildWindowStore(RETENTION_PERIOD, WINDOW_SIZE, true, Serdes.Integer(), Serdes.String()); - windowStore.init((StateStoreContext) context, windowStore); - - final long startTime = SEGMENT_INTERVAL - 4L; - - setCurrentTime(startTime); - windowStore.put(0, "zero"); - - assertEquals( - new HashSet<>(Collections.singletonList("zero")), - valuesToSet(windowStore.fetch(0, ofEpochMilli(startTime - WINDOW_SIZE), - ofEpochMilli(startTime + WINDOW_SIZE)))); - - windowStore.put(0, "zero"); - windowStore.put(0, "zero+"); - windowStore.put(0, "zero++"); - - assertEquals( - new HashSet<>(asList("zero", "zero", "zero+", "zero++")), - valuesToSet(windowStore.fetch( - 0, - ofEpochMilli(startTime - WINDOW_SIZE), - ofEpochMilli(startTime + WINDOW_SIZE)))); - assertEquals( - new HashSet<>(asList("zero", "zero", "zero+", "zero++")), - valuesToSet(windowStore.fetch( - 0, - ofEpochMilli(startTime + 1L - WINDOW_SIZE), - ofEpochMilli(startTime + 1L + WINDOW_SIZE)))); - assertEquals( - new HashSet<>(asList("zero", "zero", "zero+", "zero++")), - valuesToSet(windowStore.fetch( - 0, - ofEpochMilli(startTime + 2L - WINDOW_SIZE), - ofEpochMilli(startTime + 2L + WINDOW_SIZE)))); - assertEquals( - new HashSet<>(asList("zero", "zero", "zero+", "zero++")), - valuesToSet(windowStore.fetch( - 0, - ofEpochMilli(startTime + 3L - WINDOW_SIZE), - ofEpochMilli(startTime + 3L + WINDOW_SIZE)))); - assertEquals( - new HashSet<>(Collections.emptyList()), - valuesToSet(windowStore.fetch( - 0, - ofEpochMilli(startTime + 4L - WINDOW_SIZE), - ofEpochMilli(startTime + 4L + WINDOW_SIZE)))); - - // Flush the store and verify all current entries were properly flushed ... - windowStore.flush(); - - final List<KeyValue<byte[], byte[]>> changeLog = new ArrayList<>(); - for (final ProducerRecord<Object, Object> record : recordCollector.collected()) { - changeLog.add(new KeyValue<>(((Bytes) record.key()).get(), (byte[]) record.value())); - } - - final Map<Integer, Set<String>> entriesByKey = entriesByKey(changeLog, startTime); - - assertEquals(Utils.mkSet("zero@0", "zero@0", "zero+@0", "zero++@0"), entriesByKey.get(0)); - } - @Test public void shouldCloseOpenIteratorsWhenStoreIsClosedAndNotThrowInvalidStateStoreExceptionOnHasNext() { - setCurrentTime(0); + context.setRecordContext(createRecordContext(0)); Review comment: Seems that we don't :) will remove this line. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org