From d43136f23ac9c87ac3d2714eb75df5b927b33e14 Mon Sep 17 00:00:00 2001 From: Louis Wasserman Date: Wed, 13 May 2020 13:55:15 -0700 Subject: [PATCH] Remove more constantly flaky tests. --- .../java/io/grpc/kotlin/ClientCallsTest.kt | 52 ------------------- 1 file changed, 52 deletions(-) diff --git a/stub/src/test/java/io/grpc/kotlin/ClientCallsTest.kt b/stub/src/test/java/io/grpc/kotlin/ClientCallsTest.kt index 227927f5..c35d4ef3 100644 --- a/stub/src/test/java/io/grpc/kotlin/ClientCallsTest.kt +++ b/stub/src/test/java/io/grpc/kotlin/ClientCallsTest.kt @@ -406,58 +406,6 @@ class ClientCallsTest: AbstractCallsTest() { } } - @FlowPreview - @Test - fun clientStreamingRpcCancellation() = runBlocking { - val serverCancelled = Job() - val serverReceived = Job() - val serverImpl = object : GreeterGrpc.GreeterImplBase() { - override fun clientStreamSayHello( - responseObserver: StreamObserver - ): StreamObserver { - return object : StreamObserver { - private val names = mutableListOf() - - override fun onNext(value: HelloRequest) { - whenContextIsCancelled { serverCancelled.complete() } - Context.current().withCancellation().addListener( - Context.CancellationListener { - serverCancelled.complete() - }, - directExecutor() - ) - serverReceived.complete() - names += value.name - } - - override fun onError(t: Throwable) = throw t - - override fun onCompleted() { - responseObserver.onNext( - helloReply(names.joinToString(prefix = "Hello, ", separator = ", ")) - ) - responseObserver.onCompleted() - } - } - } - } - - channel = makeChannel(serverImpl) - - val requests = Channel() - val rpc = async { - ClientCalls.clientStreamingRpc( - channel = channel, - method = clientStreamingSayHelloMethod, - requests = requests.consumeAsFlow() - ) - } - requests.send(helloRequest("Tim")) - serverReceived.join() - rpc.cancel(CancellationException("no longer needed")) - serverCancelled.join() - } - @FlowPreview @Test fun clientStreamingRpcCancelled() = runBlocking {