Skip to content

Commit 68efade

Browse files
committed
Set hard-coded deadline to just under 1 year
10 years exceeds the maximum for some systems at the moment. Change to 1 year to workaround such systems while they get changed. And since "have the default be a large number instead of not present" is a temporary fix anyway.
1 parent 1b3f9a3 commit 68efade

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

interop-testing/src/test/java/io/grpc/stub/StubConfigTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void testConfigureTimeout() {
5555
// Create a default stub
5656
TestServiceGrpc.TestServiceBlockingStub stub =
5757
TestServiceGrpc.newBlockingStub(new FakeChannel());
58-
assertEquals(TimeUnit.DAYS.toMicros(10 * 365),
58+
assertEquals(TimeUnit.DAYS.toMicros(364),
5959
stub.getServiceDescriptor().fullDuplexCall.getTimeout());
6060
// Reconfigure it
6161
stub = stub.configureNewStub()
@@ -65,7 +65,7 @@ public void testConfigureTimeout() {
6565
assertEquals(TimeUnit.SECONDS.toMicros(2),
6666
stub.getServiceDescriptor().fullDuplexCall.getTimeout());
6767
// Default config unchanged
68-
assertEquals(TimeUnit.DAYS.toMicros(10 * 365),
68+
assertEquals(TimeUnit.DAYS.toMicros(364),
6969
TestServiceGrpc.CONFIG.fullDuplexCall.getTimeout());
7070
}
7171

stub/src/main/java/io/grpc/stub/ClientCalls.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static <RequestT, ResponseT> MethodDescriptor<RequestT, ResponseT> create
6969
// TODO(zhangkun83): if timeout is not defined in proto file, use a default timeout here.
7070
// If timeout is defined in proto file, Method should carry the timeout.
7171
return MethodDescriptor.create(method.getType(), fullServiceName + "/" + method.getName(),
72-
10 * 365, TimeUnit.DAYS, method.getRequestMarshaller(), method.getResponseMarshaller());
72+
364, TimeUnit.DAYS, method.getRequestMarshaller(), method.getResponseMarshaller());
7373
}
7474

7575
/**

0 commit comments

Comments
 (0)