Skip to content

Commit b0163ab

Browse files
committed
[FLINK-38536] Add debugging for test failure
Signed-off-by: davidradl <[email protected]>
1 parent 5b61b1c commit b0163ab

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/FinalizeOnMasterTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import org.apache.flink.api.common.JobStatus;
2222
import org.apache.flink.runtime.concurrent.ComponentMainThreadExecutorServiceAdapter;
23+
import org.apache.flink.runtime.io.disk.iomanager.AsynchronousFileIOChannelTest;
2324
import org.apache.flink.runtime.jobgraph.JobGraphTestUtils;
2425
import org.apache.flink.runtime.jobgraph.JobVertex;
2526
import org.apache.flink.runtime.jobgraph.JobVertex.FinalizeOnMasterContext;
@@ -30,6 +31,8 @@
3031

3132
import org.junit.jupiter.api.Test;
3233
import org.junit.jupiter.api.extension.RegisterExtension;
34+
import org.slf4j.Logger;
35+
import org.slf4j.LoggerFactory;
3336

3437
import java.util.concurrent.ScheduledExecutorService;
3538

@@ -45,6 +48,7 @@
4548
* only when the execution graph reaches the successful final state.
4649
*/
4750
class FinalizeOnMasterTest {
51+
private static final Logger LOG = LoggerFactory.getLogger(FinalizeOnMasterTest.class);
4852

4953
@RegisterExtension
5054
static final TestExecutorExtension<ScheduledExecutorService> EXECUTOR_RESOURCE =
@@ -68,7 +72,11 @@ void testFinalizeIsCalledUponSuccess() throws Exception {
6872
scheduler.startScheduling();
6973

7074
final ExecutionGraph eg = scheduler.getExecutionGraph();
71-
75+
if (!eg.getState().equals(JobStatus.RUNNING)) {
76+
ErrorInfo ei = eg.getFailureInfo();
77+
LOG.info("Unexpected state found: Exception as string " + ei.getExceptionAsString());
78+
LOG.info("Unexpected state found: ErrorInfo as string " + ei);
79+
}
7280
assertThat(eg.getState()).isEqualTo(JobStatus.RUNNING);
7381

7482
ExecutionGraphTestUtils.switchAllVerticesToRunning(eg);

0 commit comments

Comments
 (0)