Skip to content

Commit

Permalink
Add sleeps after zadd() calls
Browse files Browse the repository at this point in the history
To help make sure data is consistent without WAIT
  • Loading branch information
jduo committed Jun 28, 2024
1 parent 16d8f60 commit e9e1544
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions java/integTest/src/test/java/glide/SharedCommandTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -7178,6 +7178,12 @@ public void zscan(BaseClient client) {

// Result contains the whole set
assertEquals(charMembers.length, client.zadd(key1, charMap).get());
// Sleep after zadd() for eventual consistency.
// TODO: Replace sleep with WAIT request to enforce strong consistency.
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
}
result = client.zscan(key1, initialCursor).get();
assertEquals(String.valueOf(initialCursor), result[resultCursorIndex]);
assertEquals(
Expand Down Expand Up @@ -7215,6 +7221,12 @@ public void zscan(BaseClient client) {

// Result contains a subset of the key
assertEquals(numberMap.size(), client.zadd(key1, numberMap).get());
// Sleep after zadd() for eventual consistency.
// TODO: Replace sleep with WAIT request to enforce strong consistency.
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
}
long resultCursor = 0;
final Set<Object> secondResultAllKeys = new HashSet<>();
final Set<Object> secondResultAllValues = new HashSet<>();
Expand Down

0 comments on commit e9e1544

Please sign in to comment.