Skip to content

Commit

Permalink
KNOX-2635 - GatewayAppFuncTest is flaky (apache#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroflag authored Jul 20, 2021
1 parent 7daacd2 commit c8e115b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.knox.gateway;

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
Expand Down Expand Up @@ -88,7 +89,7 @@ public static void tearDownAfterClass() throws Exception {

@After
public void cleanupTest() throws Exception {
FileUtils.cleanDirectory( new File( config.getGatewayTopologyDir() ) );
cleanTopologyDir();
// Test run should not fail if deleting deployment files is not successful.
// Deletion has been already done by TopologyService.
FileUtils.deleteQuietly( new File( config.getGatewayDeploymentDir() ) );
Expand Down Expand Up @@ -536,6 +537,7 @@ public void testDeploymentCleanup() throws Exception {
} finally {
gateway.stop();
config.setGatewayDeploymentsBackupAgeLimit( oldVersionLimit );
cleanTopologyDir();
startGatewayServer();
}

Expand Down Expand Up @@ -646,9 +648,14 @@ public void testDefaultTopology() throws Exception {
} finally {
gateway.stop();
config.setDefaultTopologyName( null );
cleanTopologyDir();
startGatewayServer();
}

LOG_EXIT();
}

private void cleanTopologyDir() throws IOException {
FileUtils.cleanDirectory(new File(config.getGatewayTopologyDir()));
}
}

0 comments on commit c8e115b

Please sign in to comment.