Skip to content

Commit

Permalink
Fix race condition in test
Browse files Browse the repository at this point in the history
  • Loading branch information
lhotari committed Jan 21, 2025
1 parent 7bc7b92 commit 7bca0ad
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,11 @@ public void testMessageOrderInSingleConsumerReconnect(KeySharedImplementationTyp
for (int i = 0; i < 1000; i++) {
String key = String.valueOf(random.nextInt(numberOfKeys));
//log.info("Producing message with key: {} value: {}", key, i);
remainingMessageValues.add(i);
producer.newMessage()
.key(key)
.value(i)
.send();
remainingMessageValues.add(i);
}

// reconnect c2
Expand All @@ -296,11 +296,11 @@ public void testMessageOrderInSingleConsumerReconnect(KeySharedImplementationTyp
for (int i = 1000; i < 1100; i++) {
String key = keysForC2List.get(random.nextInt(keysForC2List.size()));
log.info("Producing message with key: {} value: {}", key, i);
remainingMessageValues.add(i);
producer.newMessage()
.key(key)
.value(i)
.send();
remainingMessageValues.add(i);
}

Thread.sleep(2 * pauseTime);
Expand Down

0 comments on commit 7bca0ad

Please sign in to comment.