From e285bf1a5247711970a80d8c18b8d19483d2762b Mon Sep 17 00:00:00 2001 From: Chris Eager Date: Tue, 29 Apr 2025 10:09:50 -0500 Subject: [PATCH] Fix test by using generic `exists` command --- .../textsecuregcm/storage/MessagesCacheTest.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/MessagesCacheTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/MessagesCacheTest.java index f03795b47..b88e32452 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/MessagesCacheTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/MessagesCacheTest.java @@ -9,8 +9,6 @@ import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertIterableEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -56,7 +54,6 @@ import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; -import java.util.stream.IntStream; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.RandomStringUtils; import org.junit.jupiter.api.AfterEach; @@ -459,7 +456,7 @@ class MessagesCacheTest { do { exists = 1 == REDIS_CLUSTER_EXTENSION.getRedisCluster() .withBinaryCluster(conn -> - conn.sync().hlen(MessagesCache.getMessageQueueKey(destinationServiceId.uuid(), deviceId))); + conn.sync().exists(MessagesCache.getMessageQueueKey(destinationServiceId.uuid(), deviceId))); } while (exists); }, "Stale MRM message should be deleted asynchronously");