[
https://issues.apache.org/jira/browse/FLINK-7909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16316489#comment-16316489
]
ASF GitHub Bot commented on FLINK-7909:
---------------------------------------
Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/4896#discussion_r160172988
--- 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 --
Will rework it.
> Unify cluster creation for test bases
> -------------------------------------
>
> Key: FLINK-7909
> URL: https://issues.apache.org/jira/browse/FLINK-7909
> Project: Flink
> Issue Type: Improvement
> Components: Tests
> Affects Versions: 1.4.0
> Reporter: Till Rohrmann
> Assignee: Till Rohrmann
>
> Flink contains different test bases, e.g. {{AbstractTestBase}},
> {{MultipleProgramsTestBase}}, {{JavaProgramTestBase}} and the
> {{StreamingMultipleProgramsTestBase}}. Some of them start resources
> ({{FlinkMiniCluster}}) automatically, while others expose a start method.
> Some test bases set the {{ExecutionEnvironment}} while others use the
> {{FlinkMiniCluster}} directly. In order to make things more maintainable I
> propose to unify these test bases a bit and introduce an {{ExternalResource}}
> which encapsulates the resource start up and shut down.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)