From 7723837ac62c1039ddda2f31269fbe9344f78391 Mon Sep 17 00:00:00 2001 From: Julien Ruaux Date: Fri, 16 Jun 2023 11:33:19 -0700 Subject: [PATCH] test: Added wait --- .../test/java/com/redis/riot/cli/AbstractRiotTests.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/riot/src/test/java/com/redis/riot/cli/AbstractRiotTests.java b/plugins/riot/src/test/java/com/redis/riot/cli/AbstractRiotTests.java index 3d73c1c8d..6612700f1 100644 --- a/plugins/riot/src/test/java/com/redis/riot/cli/AbstractRiotTests.java +++ b/plugins/riot/src/test/java/com/redis/riot/cli/AbstractRiotTests.java @@ -57,7 +57,6 @@ import com.redis.lettucemod.search.TextField.PhoneticMatcher; import com.redis.lettucemod.timeseries.MRangeOptions; import com.redis.lettucemod.timeseries.RangeResult; -import com.redis.lettucemod.timeseries.Sample; import com.redis.lettucemod.timeseries.TimeRange; import com.redis.lettucemod.util.RedisModulesUtils; import com.redis.riot.cli.common.GenerateOptions; @@ -679,8 +678,7 @@ void fakerInfer() throws Exception { @Test void fakerTsAdd() throws Exception { execute("faker-import-tsadd"); - List samples = connection.sync().tsRange("ts:gen", TimeRange.unbounded(), null); - Assertions.assertEquals(10, samples.size()); + awaitUntil(() -> connection.sync().tsRange("ts:gen", TimeRange.unbounded()).size() == 10); } @Test @@ -694,8 +692,8 @@ void fakerTsAddWithOptions() throws Exception { @Test void generateTypes() throws Exception { execute("generate"); - Assertions.assertEquals(Math.min(GenerateOptions.DEFAULT_COUNT, - GenerateOptions.DEFAULT_KEY_RANGE.getMax()), connection.sync().dbsize()); + Assertions.assertEquals(Math.min(GenerateOptions.DEFAULT_COUNT, GenerateOptions.DEFAULT_KEY_RANGE.getMax()), + connection.sync().dbsize()); } @Test