FALCON-2334 Tests in UpdateHelperTest suite fails with ParentNotDirectoryException
authorsonia-garudi <sgarudi@us.ibm.com>
Tue, 17 Apr 2018 08:53:32 +0000 (14:23 +0530)
committerpallavi-rao <pallavi.rao@inmobi.com>
Tue, 17 Apr 2018 08:53:32 +0000 (14:23 +0530)
commit411d90c2ffb59559770d23d4bd2f7675e46392e6
treec559b8864d3553ccaed1f1c05474bd3d58c8d0db
parent272e999c1bd5f288470adeeb6ff7d6af96ca9101
FALCON-2334 Tests in UpdateHelperTest suite fails with ParentNotDirectoryException

The UpdateHelperTest tests fails with the following error :
`Parent path is not a directory: /var/lib/jenkins/workspace/falcon/common/target/falcon/tmp-hadoop-jenkins/jail-fs/testCluster/projects/falcon/staging/falcon/workflows/process/sample`

The errors occurs only when the EntityUtilTest#testIsStagingPath test runs before the tests mentioned above.

The following code in EntityUtilTest#testIsStagingPath creates a file at path - target/falcon/tmp-hadoop-jenkins/jail-fs/testCluster/projects/falcon/staging/falcon/workflows/process/sample  which causes the error :

```
if (createPath && !fs.exists(path)) {
 fs.create(path);
 }
```
The change proposed in this pull request deletes the files created in EntityUtilTest#testIsStagingPath after the test checks are done.

Author: sonia-garudi <sgarudi@us.ibm.com>

Reviewers: @pallavi-rao

Closes #408 from sonia-garudi/FALCON-2334
common/src/test/java/org/apache/falcon/entity/EntityUtilTest.java