More cleanup in gRPC tests
This commit is contained in:
@@ -117,7 +117,7 @@ public class GrpcInteractionTests {
|
|||||||
Flux<Message<byte[]>> clientResponseObserver =
|
Flux<Message<byte[]>> clientResponseObserver =
|
||||||
GrpcUtils.biStreaming("localhost", port, Flux.fromIterable(messages));
|
GrpcUtils.biStreaming("localhost", port, Flux.fromIterable(messages));
|
||||||
|
|
||||||
List<Message<byte[]>> results = clientResponseObserver.collectList().block(Duration.ofSeconds(10));
|
List<Message<byte[]>> results = clientResponseObserver.collectList().block(Duration.ofSeconds(100));
|
||||||
assertThat(results.size()).isEqualTo(3);
|
assertThat(results.size()).isEqualTo(3);
|
||||||
assertThat(results.get(0).getPayload()).isEqualTo("\"RICKY\"".getBytes());
|
assertThat(results.get(0).getPayload()).isEqualTo("\"RICKY\"".getBytes());
|
||||||
assertThat(results.get(1).getPayload()).isEqualTo("\"JULIEN\"".getBytes());
|
assertThat(results.get(1).getPayload()).isEqualTo("\"JULIEN\"".getBytes());
|
||||||
@@ -226,7 +226,7 @@ public class GrpcInteractionTests {
|
|||||||
GrpcUtils.biStreaming("localhost", port, Flux.fromIterable(messages));
|
GrpcUtils.biStreaming("localhost", port, Flux.fromIterable(messages));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
clientResponseObserver.collectList().block(Duration.ofSeconds(10));
|
clientResponseObserver.collectList().block(Duration.ofSeconds(1));
|
||||||
fail();
|
fail();
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
@@ -288,7 +288,7 @@ public class GrpcInteractionTests {
|
|||||||
public Function<Flux<String>, String> streamInStringOut() {
|
public Function<Flux<String>, String> streamInStringOut() {
|
||||||
return flux -> flux.doOnNext(v -> {
|
return flux -> flux.doOnNext(v -> {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(new Random().nextInt(2000)); // artificial delay
|
Thread.sleep(new Random().nextInt(200)); // artificial delay
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
// ignore
|
// ignore
|
||||||
|
|||||||
Reference in New Issue
Block a user