flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] zentol commented on a change in pull request #8534: [FLINK-12614][yarn] Refactor test to not do assertions in @After methods
Date Mon, 27 May 2019 09:23:16 GMT
zentol commented on a change in pull request #8534: [FLINK-12614][yarn] Refactor test to not
do assertions in @After methods 
URL: https://github.com/apache/flink/pull/8534#discussion_r287714301
 
 

 ##########
 File path: flink-yarn-tests/src/test/java/org/apache/flink/yarn/YarnTestBase.java
 ##########
 @@ -212,30 +212,45 @@ public void checkClusterEmpty() {
 	 * Sleep a bit between the tests (we are re-using the YARN cluster for the tests).
 	 */
 	@After
-	public void sleep() throws IOException, YarnException {
-		Deadline deadline = Deadline.now().plus(Duration.ofSeconds(10));
+	public void shutdownYarnClient() {
+		yarnClient.stop();
+	}
 
-		boolean isAnyJobRunning = yarnClient.getApplications().stream()
-			.anyMatch(YarnTestBase::isApplicationRunning);
+	protected void runTest(RunnableWithException test) {
+		Throwable testFailure = null;
+		try {
+			test.run();
+		} catch (Throwable t) {
+			testFailure = t;
 
 Review comment:
   Since the finally block can throw exceptions, without catching the exception here you would
end up swallowing either the test or cleanup exception entirely, which would be worse than
the current state.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message