Github user GJL commented on a diff in the pull request: https://github.com/apache/flink/pull/4896#discussion_r158264752 --- Diff: flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/streaming/util/StreamingProgramTestBase.java --- @@ -66,47 +47,34 @@ protected void postSubmit() throws Exception {} @Test public void testJob() throws Exception { + // pre-submit try { - // pre-submit - try { - preSubmit(); - } - catch (Exception e) { - System.err.println(e.getMessage()); - e.printStackTrace(); - fail("Pre-submit work caused an error: " + e.getMessage()); - } - - // prepare the test environment - startCluster(); - - TestStreamEnvironment.setAsContext(this.executor, getParallelism()); + preSubmit(); + } + catch (Exception e) { + System.err.println(e.getMessage()); + e.printStackTrace(); + fail("Pre-submit work caused an error: " + e.getMessage()); --- End diff -- nit: The test should fail on exception anyways. If you want to leave it to keep the diff smaller, it's also ok.
---