Skip to content

Commit

Permalink
Try to revert test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
barshaul committed Apr 21, 2024
1 parent 47a8d78 commit c6496a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
14 changes: 10 additions & 4 deletions java/integTest/src/test/java/glide/SharedCommandTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -1813,12 +1813,15 @@ public void brpop(BaseClient client) {

// nothing popped out
assertNull(
client.brpop(new String[] {listKey2}, REDIS_VERSION.isLowerThan("7.0.0") ? 1. : 0.5).get());
client
.brpop(new String[] {listKey2}, REDIS_VERSION.isLowerThan("7.0.0") ? 1. : 0.0001)
.get());

// Key exists, but it is not a list
assertEquals(OK, client.set("foo", "bar").get());
ExecutionException executionException =
assertThrows(ExecutionException.class, () -> client.brpop(new String[] {"foo"}, 0.5).get());
assertThrows(
ExecutionException.class, () -> client.brpop(new String[] {"foo"}, 0.0001).get());
assertTrue(executionException.getCause() instanceof RequestException);
}

Expand Down Expand Up @@ -1863,12 +1866,15 @@ public void blpop(BaseClient client) {

// nothing popped out
assertNull(
client.blpop(new String[] {listKey2}, REDIS_VERSION.isLowerThan("7.0.0") ? 1. : 0.5).get());
client
.blpop(new String[] {listKey2}, REDIS_VERSION.isLowerThan("7.0.0") ? 1. : 0.0001)
.get());

// Key exists, but it is not a list
assertEquals(OK, client.set("foo", "bar").get());
ExecutionException executionException =
assertThrows(ExecutionException.class, () -> client.blpop(new String[] {"foo"}, 0.5).get());
assertThrows(
ExecutionException.class, () -> client.blpop(new String[] {"foo"}, 0.0001).get());
assertTrue(executionException.getCause() instanceof RequestException);
}

Expand Down
6 changes: 3 additions & 3 deletions node/tests/SharedTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2041,14 +2041,14 @@ export function runBaseTests<Context>(config: {
await client.rpush("brpop-test", ["foo", "bar", "baz"]),
).toEqual(3);
// Test basic usage
expect(await client.brpop(["brpop-test"], 0.5)).toEqual([
expect(await client.brpop(["brpop-test"], 0.1)).toEqual([
"brpop-test",
"baz",
]);
// Delete all values from list
expect(await client.del(["brpop-test"])).toEqual(1);
// Test null return when key doesn't exist
expect(await client.brpop(["brpop-test"], 0.5)).toEqual(null);
// Test null return when key doesn't exis
expect(await client.brpop(["brpop-test"], 0.1)).toEqual(null);
}, protocol);
},
config.timeout,
Expand Down

0 comments on commit c6496a7

Please sign in to comment.