You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/05/10 13:05:01 UTC

[GitHub] [kafka] jlprat commented on a change in pull request #10643: KAFKA-12747: Fix flakiness in shouldReturnUUIDsWithStringPrefix

jlprat commented on a change in pull request #10643:
URL: https://github.com/apache/kafka/pull/10643#discussion_r629341305



##########
File path: streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBStoreTest.java
##########
@@ -451,17 +453,14 @@ public void shouldReturnUUIDsWithStringPrefix() {
         rocksDBStore.flush();
 
         final KeyValueIterator<Bytes, byte[]> keysWithPrefix = rocksDBStore.prefixScan(prefix, stringSerializer);
-        final List<String> valuesWithPrefix = new ArrayList<>();
         int numberOfKeysReturned = 0;
 
         while (keysWithPrefix.hasNext()) {
-            final KeyValue<Bytes, byte[]> next = keysWithPrefix.next();
-            valuesWithPrefix.add(new String(next.value));
+            keysWithPrefix.next();
             numberOfKeysReturned++;
         }
 
-        assertThat(numberOfKeysReturned, is(1));
-        assertThat(valuesWithPrefix.get(0), is("a"));

Review comment:
       I would still try to keep this assertion, something among the lines of:
   ```java
   if (clashOnPrefix) {
       assertThat(valuesWithPrefix.get(0), either(is("a")).or(is("b")));
   } else {
       assertThat(valuesWithPrefix.get(0), is("a"));
   }
   ```




-- 
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:
users@infra.apache.org