azagrebin commented on a change in pull request #11285: [FLINK-16189][e2e]
Remove test logic from FlinkDistribution
URL: https://github.com/apache/flink/pull/11285#discussion_r387611941
##########
File path:
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/LocalStandaloneFlinkResource.java
##########
@@ -71,12 +90,33 @@ public void before() throws Exception {
@Override
public void afterTestSuccess() {
- distribution.afterTestSuccess();
+ shutdownCluster();
+ temporaryFolder.delete();
}
@Override
public void afterTestFailure() {
- distribution.afterTestFailure();
+ if (distribution != null) {
+ shutdownCluster();
+ if (logBackupDirectory != null) {
+ final Path targetDirectory =
logBackupDirectory.resolve(UUID.randomUUID().toString());
+ try {
+
distribution.copyLogsTo(targetDirectory);
+ LOG.info("Backed up logs to {}.",
targetDirectory);
+ } catch (IOException e) {
+ LOG.warn("An error has occurred while
backing up logs to {}.", targetDirectory, e);
+ }
+ }
Review comment:
`backupLogs();`
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services