From 4ce6347843387e21b52297ea256398fa77e96f3c Mon Sep 17 00:00:00 2001 From: Julien Ruaux Date: Mon, 2 Jan 2023 22:47:46 +0800 Subject: [PATCH] test: Added sleep timeout --- .../java/com/redis/trino/TestRediSearchConnectorSmokeTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/redis/trino/TestRediSearchConnectorSmokeTest.java b/src/test/java/com/redis/trino/TestRediSearchConnectorSmokeTest.java index 492f0bd..8ba93d4 100644 --- a/src/test/java/com/redis/trino/TestRediSearchConnectorSmokeTest.java +++ b/src/test/java/com/redis/trino/TestRediSearchConnectorSmokeTest.java @@ -55,7 +55,8 @@ private void deleteBeers() throws InterruptedException { } catch (Exception e) { // ignore } - while (redisearch.getTestContext().sync().dbsize() > 0) { + long start = System.currentTimeMillis(); + while (redisearch.getTestContext().sync().dbsize() > 0 && System.currentTimeMillis() < start + 3000) { Thread.sleep(10); } }