zentol commented on a change in pull request #10106: [FLINK-11463][e2e] Design 
the e2e java framework so that at least the Kafka streaming tests can run on it
URL: https://github.com/apache/flink/pull/10106#discussion_r345771708
 
 

 ##########
 File path: 
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/FlinkDistribution.java
 ##########
 @@ -113,39 +116,34 @@ public void afterTestSuccess() {
                        LOG.error("Failure while shutting down Flink cluster.", 
e);
                }
 
-               final Path originalConfig = conf.resolve(FLINK_CONF_YAML);
-               final Path backupConfig = conf.resolve(FLINK_CONF_YAML_BACKUP);
-
-               try {
-                       Files.move(backupConfig, originalConfig, 
StandardCopyOption.REPLACE_EXISTING);
-               } catch (IOException e) {
-                       LOG.error("Failed to restore flink-conf.yaml", e);
-               }
-
-               for (AutoCloseable fileToDelete : filesToDelete) {
-                       try {
-                               fileToDelete.close();
-                       } catch (Exception e) {
-                               LOG.error("Failure while cleaning up file.", e);
-                       }
-               }
+               temporaryFolder.delete();
        }
 
        @Override
        public void afterTestFailure() {
-               logBackupDir.ifPresent(backupLocation -> {
-                       LOG.info("Backing up logs to {}.", backupLocation);
+               if (logBackupDir != null) {
+                       final UUID id = UUID.randomUUID();
+                       LOG.info("Backing up logs to {}/{}.", logBackupDir, id);
                        try {
-                               Files.createDirectories(backupLocation);
-                               FileUtils.copyDirectory(log.toFile(), 
backupLocation.toFile());
+                               Files.createDirectories(logBackupDir);
+                               FileUtils.copyDirectory(log.toFile(), 
logBackupDir.resolve(id.toString()).toFile());
 
 Review comment:
   could use the copy method from `TestUtils` here.

----------------------------------------------------------------
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

Reply via email to