From 3e447610ba8cbedad71b001cf4d8e606b6fe645d Mon Sep 17 00:00:00 2001 From: Ruben de Vries Date: Mon, 6 May 2019 10:58:23 +0200 Subject: [PATCH] docs: add note about directExecutor in example tests. --- .../io/grpc/examples/helloworld/HelloWorldClientTest.java | 4 ++++ .../io/grpc/examples/helloworld/HelloWorldServerTest.java | 4 ++++ .../io/grpc/examples/routeguide/RouteGuideClientTest.java | 4 ++++ .../io/grpc/examples/routeguide/RouteGuideServerTest.java | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/examples/src/test/java/io/grpc/examples/helloworld/HelloWorldClientTest.java b/examples/src/test/java/io/grpc/examples/helloworld/HelloWorldClientTest.java index e69bc05dfe9..4ba747dcd27 100644 --- a/examples/src/test/java/io/grpc/examples/helloworld/HelloWorldClientTest.java +++ b/examples/src/test/java/io/grpc/examples/helloworld/HelloWorldClientTest.java @@ -39,6 +39,10 @@ * For demonstrating how to write gRPC unit test only. * Not intended to provide a high code coverage or to test every major usecase. * + * directExecutor() makes it easier to have deterministic tests. + * However, if your implementation uses another thread and uses streaming it is better to use + * the default executor, to avoid hitting bug #3084. + * *

For more unit test examples see {@link io.grpc.examples.routeguide.RouteGuideClientTest} and * {@link io.grpc.examples.routeguide.RouteGuideServerTest}. */ diff --git a/examples/src/test/java/io/grpc/examples/helloworld/HelloWorldServerTest.java b/examples/src/test/java/io/grpc/examples/helloworld/HelloWorldServerTest.java index 46d39559942..9a20476772c 100644 --- a/examples/src/test/java/io/grpc/examples/helloworld/HelloWorldServerTest.java +++ b/examples/src/test/java/io/grpc/examples/helloworld/HelloWorldServerTest.java @@ -32,6 +32,10 @@ * For demonstrating how to write gRPC unit test only. * Not intended to provide a high code coverage or to test every major usecase. * + * directExecutor() makes it easier to have deterministic tests. + * However, if your implementation uses another thread and uses streaming it is better to use + * the default executor, to avoid hitting bug #3084. + * *

For more unit test examples see {@link io.grpc.examples.routeguide.RouteGuideClientTest} and * {@link io.grpc.examples.routeguide.RouteGuideServerTest}. */ diff --git a/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideClientTest.java b/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideClientTest.java index 531892808dc..fbe1ae20b1d 100644 --- a/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideClientTest.java +++ b/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideClientTest.java @@ -53,6 +53,10 @@ * For demonstrating how to write gRPC unit test only. * Not intended to provide a high code coverage or to test every major usecase. * + * directExecutor() makes it easier to have deterministic tests. + * However, if your implementation uses another thread and uses streaming it is better to use + * the default executor, to avoid hitting bug #3084. + * *

For basic unit test examples see {@link io.grpc.examples.helloworld.HelloWorldClientTest} and * {@link io.grpc.examples.helloworld.HelloWorldServerTest}. */ diff --git a/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideServerTest.java b/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideServerTest.java index 01013415d27..75b9f63780a 100644 --- a/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideServerTest.java +++ b/examples/src/test/java/io/grpc/examples/routeguide/RouteGuideServerTest.java @@ -49,6 +49,10 @@ * For demonstrating how to write gRPC unit test only. * Not intended to provide a high code coverage or to test every major usecase. * + * directExecutor() makes it easier to have deterministic tests. + * However, if your implementation uses another thread and uses streaming it is better to use + * the default executor, to avoid hitting bug #3084. + * *

For basic unit test examples see {@link io.grpc.examples.helloworld.HelloWorldClientTest} and * {@link io.grpc.examples.helloworld.HelloWorldServerTest}. */