diff --git a/runners/portability/java/src/main/java/org/apache/beam/runners/portability/JobServicePipelineResult.java b/runners/portability/java/src/main/java/org/apache/beam/runners/portability/JobServicePipelineResult.java index 478c75569451..b631a810aecf 100644 --- a/runners/portability/java/src/main/java/org/apache/beam/runners/portability/JobServicePipelineResult.java +++ b/runners/portability/java/src/main/java/org/apache/beam/runners/portability/JobServicePipelineResult.java @@ -153,7 +153,7 @@ private void waitForTerminalState() { Thread.currentThread().interrupt(); throw new RuntimeException(e); } - response = stub.getState(request); + response = stub.withDeadlineAfter(jobServerTimeout, TimeUnit.SECONDS).getState(request); lastState = getJavaState(response.getState()); } terminalState = lastState;