Fix server termination

This commit is contained in:
Oleg Zhurakousky
2021-10-18 19:06:04 +02:00
parent 1c5c3e833f
commit f714178c74
2 changed files with 3 additions and 3 deletions

View File

@@ -82,8 +82,8 @@ class GrpcServer implements SmartLifecycle {
@Override
public void stop() {
logger.info("Shutting down gRPC server");
this.server.shutdown();
this.executor.shutdown();
this.server.shutdownNow();
this.executor.shutdownNow();
}
@Override

View File

@@ -117,7 +117,7 @@ public class GrpcInteractionTests {
Flux<Message<byte[]>> clientResponseObserver =
GrpcUtils.biStreaming("localhost", port, Flux.fromIterable(messages));
List<Message<byte[]>> results = clientResponseObserver.collectList().block(Duration.ofSeconds(100));
List<Message<byte[]>> results = clientResponseObserver.collectList().block(Duration.ofSeconds(10));
assertThat(results.size()).isEqualTo(3);
assertThat(results.get(0).getPayload()).isEqualTo("\"RICKY\"".getBytes());
assertThat(results.get(1).getPayload()).isEqualTo("\"JULIEN\"".getBytes());