Skip to content

Commit 21852ca

Browse files
Oleh DokukaOlegDokuka
authored andcommitted
fixes test
Signed-off-by: Oleh Dokuka <[email protected]> Signed-off-by: Oleh Dokuka <[email protected]>
1 parent 4fba9d4 commit 21852ca

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ subprojects {
4747
ext['assertj.version'] = '3.21.0'
4848
ext['netflix.limits.version'] = '0.3.6'
4949
ext['bouncycastle-bcpkix.version'] = '1.68'
50+
ext['awaitility.version'] = '4.1.1'
5051

5152
group = "io.rsocket"
5253

@@ -80,6 +81,7 @@ subprojects {
8081
dependency "org.assertj:assertj-core:${ext['assertj.version']}"
8182
dependency "org.hdrhistogram:HdrHistogram:${ext['hdrhistogram.version']}"
8283
dependency "org.slf4j:slf4j-api:${ext['slf4j.version']}"
84+
dependency "org.awaitility:awaitility:${ext['awaitility.version']}"
8385
dependencySet(group: 'org.mockito', version: ext['mockito.version']) {
8486
entry 'mockito-junit-jupiter'
8587
entry 'mockito-core'

rsocket-core/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dependencies {
3535
testImplementation 'org.junit.jupiter:junit-jupiter-api'
3636
testImplementation 'org.junit.jupiter:junit-jupiter-params'
3737
testImplementation 'org.mockito:mockito-core'
38+
testImplementation 'org.awaitility:awaitility'
3839

3940
testRuntimeOnly 'ch.qos.logback:logback-classic'
4041
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'

rsocket-core/src/test/java/io/rsocket/core/ReconnectMonoTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package io.rsocket.core;
1818

1919
import static org.assertj.core.api.Assertions.assertThat;
20+
import static org.awaitility.Awaitility.await;
2021

2122
import io.rsocket.RaceTestConstants;
2223
import io.rsocket.internal.subscriber.AssertSubscriber;
@@ -321,6 +322,7 @@ public String get() {
321322

322323
assertThat(expired).hasSize(1).containsOnly("value_to_expire" + i);
323324
if (reconnectMono.resolvingInner.subscribers == ResolvingOperator.READY) {
325+
await().atMost(Duration.ofSeconds(5)).until(() -> received.size() == 2);
324326
assertThat(received)
325327
.hasSize(2)
326328
.containsExactly(

0 commit comments

Comments
 (0)