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/06 22:28:32 UTC

[GitHub] [kafka] guozhangwang opened a new pull request #10643: KAFKA-12747: Fix flakiness in shouldReturnUUIDsWithStringPrefix

guozhangwang opened a new pull request #10643:
URL: https://github.com/apache/kafka/pull/10643


   Consecutive UUID generation could result in same prefix.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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



[GitHub] [kafka] guozhangwang merged pull request #10643: KAFKA-12747: Fix flakiness in shouldReturnUUIDsWithStringPrefix

Posted by GitBox <gi...@apache.org>.
guozhangwang merged pull request #10643:
URL: https://github.com/apache/kafka/pull/10643


   


-- 
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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
jlprat commented on pull request #10643:
URL: https://github.com/apache/kafka/pull/10643#issuecomment-836631952


   You can also take a look at https://github.com/apache/kafka/pull/10662/files#diff-944ff4a8c4eab2003ab210f5a2fceac1d124e71fcfe383b736add11803a4fd4cR468 (in there I was checking that in case of prefix clash, the content was either "a" or "b"


-- 
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



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

Posted by GitBox <gi...@apache.org>.
guozhangwang commented on pull request #10643:
URL: https://github.com/apache/kafka/pull/10643#issuecomment-837205952


   Will cherry-pick to old branches as well.


-- 
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



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

Posted by GitBox <gi...@apache.org>.
guozhangwang commented on a change in pull request #10643:
URL: https://github.com/apache/kafka/pull/10643#discussion_r629530576



##########
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:
       SG, I will do that upon merging.




-- 
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



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

Posted by GitBox <gi...@apache.org>.
guozhangwang commented on pull request #10643:
URL: https://github.com/apache/kafka/pull/10643#issuecomment-833914614


   cc @ableegoldman for reviews.


-- 
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