DATAREDIS-1199 - Polishing.
Improve test synchronization.
This commit is contained in:
@@ -2346,7 +2346,7 @@ public class JedisClusterConnectionTests implements ClusterConnectionTests {
|
||||
nativeConnection.set(KEY_1_BYTES, VALUE_1_BYTES);
|
||||
nativeConnection.get(KEY_1_BYTES);
|
||||
|
||||
assertThat(clusterConnection.keyCommands().idletime(KEY_1_BYTES)).isEqualTo(Duration.ofSeconds(0));
|
||||
assertThat(clusterConnection.keyCommands().idletime(KEY_1_BYTES)).isLessThan(Duration.ofSeconds(5));
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-716
|
||||
|
||||
@@ -415,8 +415,9 @@ public class LettuceReactiveKeyCommandsTests extends LettuceReactiveCommandsTest
|
||||
nativeCommands.set(KEY_1, "1000");
|
||||
nativeCommands.get(KEY_1);
|
||||
|
||||
connection.keyCommands().idletime(KEY_1_BBUFFER).as(StepVerifier::create).expectNext(Duration.ofSeconds(0))
|
||||
.verifyComplete();
|
||||
connection.keyCommands().idletime(KEY_1_BBUFFER).as(StepVerifier::create).assertNext(actual -> {
|
||||
assertThat(actual).isLessThan(Duration.ofSeconds(5));
|
||||
}).verifyComplete();
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-716
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.springframework.data.redis.core;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -25,6 +27,7 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
|
||||
import org.springframework.data.redis.ConnectionFactoryTracker;
|
||||
import org.springframework.data.redis.ObjectFactory;
|
||||
import org.springframework.data.redis.connection.RedisConnection;
|
||||
@@ -111,7 +114,10 @@ public class DefaultReactiveHyperLogLogOperationsIntegrationTests<K, V> {
|
||||
hyperLogLogOperations.add(key2, value2, sharedValue).as(StepVerifier::create).expectNext(1L).verifyComplete();
|
||||
|
||||
hyperLogLogOperations.union(mergedKey, key1, key2).as(StepVerifier::create).expectNext(true).verifyComplete();
|
||||
hyperLogLogOperations.size(mergedKey).as(StepVerifier::create).expectNext(3L).verifyComplete();
|
||||
hyperLogLogOperations.size(mergedKey).as(StepVerifier::create).assertNext(actual -> {
|
||||
|
||||
assertThat(actual).isBetween(2L, 3L);
|
||||
}).verifyComplete();
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-602
|
||||
|
||||
@@ -278,6 +278,8 @@ public class StreamMessageListenerContainerIntegrationTests {
|
||||
redisTemplate.delete("my-stream");
|
||||
|
||||
assertThat(failures.poll(3, TimeUnit.SECONDS)).isNotNull();
|
||||
|
||||
Awaitility.await().until(() -> !subscription.isActive());
|
||||
assertThat(subscription.isActive()).isFalse();
|
||||
|
||||
cancelAwait(subscription);
|
||||
|
||||
Reference in New Issue
Block a user