This is an automated email from the ASF dual-hosted git repository.
szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ratis.git
The following commit(s) were added to refs/heads/master by this push:
new 29d032dde RATIS-1832. Intermittent failure in
TestStreamObserverWithTimeout (#873)
29d032dde is described below
commit 29d032dde65cfb441e7c912b1621cfff6c266674
Author: Kaijie Chen <[email protected]>
AuthorDate: Fri Apr 14 22:39:19 2023 +0800
RATIS-1832. Intermittent failure in TestStreamObserverWithTimeout (#873)
---
.../src/test/java/org/apache/ratis/grpc/util/GrpcTestServer.java | 4 ++--
.../org/apache/ratis/grpc/util/TestStreamObserverWithTimeout.java | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git
a/ratis-test/src/test/java/org/apache/ratis/grpc/util/GrpcTestServer.java
b/ratis-test/src/test/java/org/apache/ratis/grpc/util/GrpcTestServer.java
index ec9d63b13..d497ac1cd 100644
--- a/ratis-test/src/test/java/org/apache/ratis/grpc/util/GrpcTestServer.java
+++ b/ratis-test/src/test/java/org/apache/ratis/grpc/util/GrpcTestServer.java
@@ -71,7 +71,7 @@ class GrpcTestServer implements Closeable {
GreeterImpl(int slow, TimeDuration timeout) {
this.slow = slow;
- this.shortSleepTime = timeout.multiply(0.25);
+ this.shortSleepTime = timeout.multiply(0.1);
this.longSleepTime = timeout.multiply(2);
}
@@ -105,4 +105,4 @@ class GrpcTestServer implements Closeable {
};
}
}
-}
\ No newline at end of file
+}
diff --git
a/ratis-test/src/test/java/org/apache/ratis/grpc/util/TestStreamObserverWithTimeout.java
b/ratis-test/src/test/java/org/apache/ratis/grpc/util/TestStreamObserverWithTimeout.java
index 1439f9b9d..89349cc87 100644
---
a/ratis-test/src/test/java/org/apache/ratis/grpc/util/TestStreamObserverWithTimeout.java
+++
b/ratis-test/src/test/java/org/apache/ratis/grpc/util/TestStreamObserverWithTimeout.java
@@ -58,14 +58,14 @@ public class TestStreamObserverWithTimeout extends BaseTest
{
@Test
public void testWithDeadline() throws Exception {
//the total sleep time is within the deadline
- runTestTimeout(2, Type.WithDeadline);
+ runTestTimeout(8, Type.WithDeadline);
}
@Test
public void testWithDeadlineFailure() {
//Expected to have DEADLINE_EXCEEDED
testFailureCase("total sleep time is longer than the deadline",
- () -> runTestTimeout(5, Type.WithDeadline),
+ () -> runTestTimeout(12, Type.WithDeadline),
ExecutionException.class, StatusRuntimeException.class);
}
@@ -73,7 +73,7 @@ public class TestStreamObserverWithTimeout extends BaseTest {
public void testWithTimeout() throws Exception {
//Each sleep time is within the timeout,
//Note that the total sleep time is longer than the timeout, but it does
not matter.
- runTestTimeout(5, Type.WithTimeout);
+ runTestTimeout(12, Type.WithTimeout);
}
void runTestTimeout(int slow, Type type) throws Exception {