Repository: falcon Updated Branches: refs/heads/master 39f64a08e -> 20eb735da
FALCON-2338 EntityGraphTest.initConfigStore fails intermittently The error occurs only when the MetadataMappingServiceTest testsuite runs before the testcase mentioned above. This test suite creates a file in target folder 'target/store/PROCESS/sample-process.xml' which isn't deleted post the test. The change proposed in this pull request deletes the files and the tests in EntityGraphTest suite passed. pallavi-rao could you please check this? thanks! Author: sonia-garudi <[email protected]> Reviewers: @pallavi-rao Closes #411 from sonia-garudi/FALCON-2338 and squashes the following commits: 54b15f90a [sonia-garudi] Removed unused and duplicate import statements b35b00dcc [sonia-garudi] Edit EntityGraphTest.java to delete the config store before and after suite Project: http://git-wip-us.apache.org/repos/asf/falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/20eb735d Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/20eb735d Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/20eb735d Branch: refs/heads/master Commit: 20eb735da21a29dd8a21744fdb8097479637a962 Parents: 39f64a0 Author: sonia-garudi <[email protected]> Authored: Thu Aug 9 15:56:33 2018 +0530 Committer: pallavi-rao <[email protected]> Committed: Thu Aug 9 15:56:33 2018 +0530 ---------------------------------------------------------------------- .../falcon/entity/v0/EntityGraphTest.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/falcon/blob/20eb735d/common/src/test/java/org/apache/falcon/entity/v0/EntityGraphTest.java ---------------------------------------------------------------------- diff --git a/common/src/test/java/org/apache/falcon/entity/v0/EntityGraphTest.java b/common/src/test/java/org/apache/falcon/entity/v0/EntityGraphTest.java index 20f2871..7cdd6c7 100644 --- a/common/src/test/java/org/apache/falcon/entity/v0/EntityGraphTest.java +++ b/common/src/test/java/org/apache/falcon/entity/v0/EntityGraphTest.java @@ -49,6 +49,14 @@ import org.testng.annotations.Test; import java.util.List; import java.util.Set; +import org.apache.falcon.util.StartupProperties; +import org.apache.hadoop.conf.Configuration; +import org.testng.annotations.AfterSuite; +import org.testng.annotations.BeforeSuite; +import java.io.IOException; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; + /** * Entity graph tests. */ @@ -475,4 +483,16 @@ public class EntityGraphTest extends AbstractTestBase { Assert.assertEquals(1, entities.size()); Assert.assertTrue(entities.contains(cluster)); } + + @BeforeSuite + @AfterSuite + public void cleanup() throws IOException { + Path path = new Path(StartupProperties.get(). + getProperty("config.store.uri")); + FileSystem fs = FileSystem.get(path.toUri(), new Configuration()); + fs.delete(path, true); + System.out.println("Cleaned up " + path); + } + + }
