Skip to content

Commit 489e75e

Browse files
authored
Increase timeouts in CallTest to reduce flakiness (#33775)
1 parent b3dd0ad commit 489e75e

File tree

2 files changed

+11
-4
lines changed
  • sdks/java
    • core/src/main/java/org/apache/beam/sdk/coders
    • io/rrio/src/test/java/org/apache/beam/io/requestresponse

2 files changed

+11
-4
lines changed

sdks/java/core/src/main/java/org/apache/beam/sdk/coders/Coder.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ public static void verifyDeterministic(Coder<?> target, String message, Iterable
198198
}
199199
}
200200

201-
public static <T> long getEncodedElementByteSizeUsingCoder(Coder<T> target, T value) throws Exception {
201+
public static <T> long getEncodedElementByteSizeUsingCoder(Coder<T> target, T value)
202+
throws Exception {
202203
return target.getEncodedElementByteSize(value);
203204
}
204205
/**

sdks/java/io/rrio/src/test/java/org/apache/beam/io/requestresponse/CallTest.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,9 @@ private static class CallerExceedsTimeout implements Caller<Request, Response> {
358358
private final Duration timeout;
359359

360360
CallerExceedsTimeout(Duration timeout) {
361-
this.timeout = timeout.plus(Duration.standardSeconds(1L));
361+
// The timeout testing is flaky so we set a sleep time with a minute padding beyond what
362+
// should trigger the timeout.
363+
this.timeout = timeout.plus(Duration.standardMinutes(1L));
362364
}
363365

364366
@Override
@@ -397,7 +399,9 @@ private static class SetupExceedsTimeout implements SetupTeardown {
397399
private final Duration timeout;
398400

399401
private SetupExceedsTimeout(Duration timeout) {
400-
this.timeout = timeout.plus(Duration.standardSeconds(1L));
402+
// The timeout testing is flaky so we set a sleep time with a minute padding beyond what
403+
// should trigger the timeout.
404+
this.timeout = timeout.plus(Duration.standardMinutes(1L));
401405
}
402406

403407
@Override
@@ -443,7 +447,9 @@ private static class TeardownExceedsTimeout implements SetupTeardown {
443447
private final Duration timeout;
444448

445449
private TeardownExceedsTimeout(Duration timeout) {
446-
this.timeout = timeout.plus(Duration.standardSeconds(1L));
450+
// The timeout testing is flaky so we set a sleep time with a minute padding beyond what
451+
// should trigger the timeout.
452+
this.timeout = timeout.plus(Duration.standardMinutes(1L));
447453
}
448454

449455
@Override

0 commit comments

Comments
 (0)