This is an automated email from the ASF dual-hosted git repository.
scwhittle pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 974ad17b60d Increase CallTest sleep durations to keep test from being
flaky due to timeout not being observed. (#39016)
974ad17b60d is described below
commit 974ad17b60df6c6cade34f713e333e8247181eba
Author: Sam Whittle <[email protected]>
AuthorDate: Fri Jun 19 11:29:33 2026 +0200
Increase CallTest sleep durations to keep test from being flaky due to
timeout not being observed. (#39016)
Also decrease configured timeouts from 1 minute to 1 second to speed up
test execution.
---
.../apache/beam/io/requestresponse/CallTest.java | 53 ++++++++++------------
1 file changed, 25 insertions(+), 28 deletions(-)
diff --git
a/sdks/java/io/rrio/src/test/java/org/apache/beam/io/requestresponse/CallTest.java
b/sdks/java/io/rrio/src/test/java/org/apache/beam/io/requestresponse/CallTest.java
index 23ced30ada5..0764ab8db40 100644
---
a/sdks/java/io/rrio/src/test/java/org/apache/beam/io/requestresponse/CallTest.java
+++
b/sdks/java/io/rrio/src/test/java/org/apache/beam/io/requestresponse/CallTest.java
@@ -123,7 +123,7 @@ public class CallTest {
@Test
public void givenCallerTimeout_emitsFailurePCollection() {
- Duration timeout = Duration.standardMinutes(1L);
+ Duration timeout = Duration.standardSeconds(1L);
Result<Response> result =
pipeline
.apply(Create.of(new Request("a")))
@@ -182,8 +182,7 @@ public class CallTest {
@Test
public void givenSetupTimeout_throwsError() {
- Duration timeout = Duration.standardMinutes(1L);
-
+ Duration timeout = Duration.standardSeconds(1L);
pipeline
.apply(Create.of(new Request("")))
.apply(
@@ -231,7 +230,7 @@ public class CallTest {
@Test
public void givenTeardownTimeout_throwsError() {
- Duration timeout = Duration.standardMinutes(1L);
+ Duration timeout = Duration.standardSeconds(1L);
pipeline
.apply(Create.of(new Request("")))
.apply(
@@ -271,7 +270,7 @@ public class CallTest {
private static class ValidCaller implements Caller<Request, Response> {
@Override
- public Response call(Request request) throws UserCodeExecutionException {
+ public Response call(Request request) {
return new Response(request.id);
}
}
@@ -282,7 +281,7 @@ public class CallTest {
private final UnSerializable nestedThing = new UnSerializable();
@Override
- public Response call(Request request) throws UserCodeExecutionException {
+ public Response call(Request request) {
return new Response(request.id);
}
}
@@ -291,10 +290,10 @@ public class CallTest {
implements SetupTeardown {
@Override
- public void setup() throws UserCodeExecutionException {}
+ public void setup() {}
@Override
- public void teardown() throws UserCodeExecutionException {}
+ public void teardown() {}
}
private static class UnSerializable {}
@@ -358,11 +357,11 @@ public class CallTest {
private final Duration timeout;
CallerExceedsTimeout(Duration timeout) {
- this.timeout = timeout.plus(Duration.standardSeconds(1L));
+ this.timeout = timeout.plus(Duration.standardSeconds(10L));
}
@Override
- public Response call(Request request) throws UserCodeExecutionException {
+ public Response call(Request request) {
sleep(timeout);
return new Response(request.id);
}
@@ -397,16 +396,16 @@ public class CallTest {
private final Duration timeout;
private SetupExceedsTimeout(Duration timeout) {
- this.timeout = timeout.plus(Duration.standardSeconds(1L));
+ this.timeout = timeout.plus(Duration.standardSeconds(10L));
}
@Override
- public void setup() throws UserCodeExecutionException {
+ public void setup() {
sleep(timeout);
}
@Override
- public void teardown() throws UserCodeExecutionException {}
+ public void teardown() {}
}
private static class SetupThrowsUserCodeExecutionException implements
SetupTeardown {
@@ -416,7 +415,7 @@ public class CallTest {
}
@Override
- public void teardown() throws UserCodeExecutionException {}
+ public void teardown() {}
}
private static class SetupThrowsUserCodeQuotaException implements
SetupTeardown {
@@ -426,7 +425,7 @@ public class CallTest {
}
@Override
- public void teardown() throws UserCodeExecutionException {}
+ public void teardown() {}
}
private static class SetupThrowsUserCodeTimeoutException implements
SetupTeardown {
@@ -436,28 +435,28 @@ public class CallTest {
}
@Override
- public void teardown() throws UserCodeExecutionException {}
+ public void teardown() {}
}
private static class TeardownExceedsTimeout implements SetupTeardown {
private final Duration timeout;
private TeardownExceedsTimeout(Duration timeout) {
- this.timeout = timeout.plus(Duration.standardSeconds(1L));
+ this.timeout = timeout.plus(Duration.standardSeconds(10L));
}
@Override
- public void setup() throws UserCodeExecutionException {}
+ public void setup() {}
@Override
- public void teardown() throws UserCodeExecutionException {
+ public void teardown() {
sleep(timeout);
}
}
private static class TeardownThrowsUserCodeExecutionException implements
SetupTeardown {
@Override
- public void setup() throws UserCodeExecutionException {}
+ public void setup() {}
@Override
public void teardown() throws UserCodeExecutionException {
@@ -467,7 +466,7 @@ public class CallTest {
private static class TeardownThrowsUserCodeQuotaException implements
SetupTeardown {
@Override
- public void setup() throws UserCodeExecutionException {}
+ public void setup() {}
@Override
public void teardown() throws UserCodeExecutionException {
@@ -477,7 +476,7 @@ public class CallTest {
private static class TeardownThrowsUserCodeTimeoutException implements
SetupTeardown {
@Override
- public void setup() throws UserCodeExecutionException {}
+ public void setup() {}
@Override
public void teardown() throws UserCodeExecutionException {
@@ -519,14 +518,12 @@ public class CallTest {
private static final Coder<String> ID_CODER = StringUtf8Coder.of();
@Override
- public void encode(Request value, @NotNull OutputStream outStream)
- throws CoderException, IOException {
+ public void encode(Request value, @NotNull OutputStream outStream) throws
IOException {
ID_CODER.encode(checkStateNotNull(value).id, outStream);
}
@Override
- public @NonNull Request decode(@NotNull InputStream inStream)
- throws CoderException, IOException {
+ public @NonNull Request decode(@NotNull InputStream inStream) throws
IOException {
String id = ID_CODER.decode(inStream);
return new Request(id);
}
@@ -542,7 +539,7 @@ public class CallTest {
@Override
public void encode(@Nullable Response value, @NotNull OutputStream
outStream)
- throws CoderException, IOException {
+ throws IOException {
if (value == null) {
ID_CODER.encode(null, outStream);
return;
@@ -551,7 +548,7 @@ public class CallTest {
}
@Override
- public Response decode(@NotNull InputStream inStream) throws
CoderException, IOException {
+ public Response decode(@NotNull InputStream inStream) throws IOException {
try {
String id = ID_CODER.decode(inStream);
return new Response(id);