You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2014/11/11 16:05:18 UTC
[15/17] incubator-slider git commit: SLIDER-622 add spin-checks for
cluster dir deletion...deals with NTFS problems
SLIDER-622 add spin-checks for cluster dir deletion...deals with NTFS problems
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/5afa9b39
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/5afa9b39
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/5afa9b39
Branch: refs/heads/releases/slider-0.60
Commit: 5afa9b39d21d396052d82b5472b344e7903a13db
Parents: 7596387
Author: Steve Loughran <st...@apache.org>
Authored: Tue Nov 11 14:11:44 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Tue Nov 11 15:04:47 2014 +0000
----------------------------------------------------------------------
.../standalone/TestStandaloneAMDestroy.groovy | 5 ++++
.../slider/test/YarnMiniClusterTestBase.groovy | 29 ++++++++++----------
2 files changed, 19 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5afa9b39/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMDestroy.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMDestroy.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMDestroy.groovy
index 4a94eb3..d25396d 100644
--- a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMDestroy.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMDestroy.groovy
@@ -121,6 +121,11 @@ class TestStandaloneAMDestroy extends AgentMiniClusterTestBase {
assert 0 == exitCode
describe "post destroy checks"
+ if (fs.exists(instanceDir)) {
+ log.warn("Destroy operation did not delete $instanceDir")
+ rigorousDelete(sliderFileSystem, instanceDir, 60000)
+ }
+
sliderFileSystem.verifyDirectoryNonexistent(instanceDir)
// look up app report and verify exit code is good
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5afa9b39/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy b/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
index 0850d25..ffd3dab 100644
--- a/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
@@ -488,11 +488,13 @@ public abstract class YarnMiniClusterTestBase extends ServiceLauncherBaseTest {
def config = miniCluster.config
if (deleteExistingData && !SliderActions.ACTION_UPDATE.equals(action)) {
HadoopFS dfs = HadoopFS.get(new URI(fsDefaultName), config)
- Path clusterDir = new SliderFileSystem(dfs, config).buildClusterDirPath(clustername)
- log.info("deleting customer data at $clusterDir")
+
+ def sliderFileSystem = new SliderFileSystem(dfs, config)
+ Path clusterDir = sliderFileSystem.buildClusterDirPath(clustername)
+ log.info("deleting instance data at $clusterDir")
//this is a safety check to stop us doing something stupid like deleting /
assert clusterDir.toString().contains("/.slider/")
- rigorousDelete(dfs, clusterDir, 60000)
+ rigorousDelete(sliderFileSystem, clusterDir, 60000)
}
@@ -543,26 +545,23 @@ public abstract class YarnMiniClusterTestBase extends ServiceLauncherBaseTest {
* Delete with some pauses and backoff; designed to handle slow delete
* operation in windows
* @param dfs
- * @param clusterDir
+ * @param path
*/
public void rigorousDelete(
- HadoopFS dfs, Path clusterDir, long timeout) {
+ SliderFileSystem sliderFileSystem,
+ Path path, long timeout) {
Duration duration = new Duration(timeout)
duration.start()
+ HadoopFS dfs = sliderFileSystem.fileSystem
boolean deleted = false;
- while (!deleted) {
- dfs.delete(clusterDir, true)
- deleted = !dfs.exists(clusterDir)
- if (!deleted ) {
- if (duration.limitExceeded) {
- assert !dfs.exists(
- clusterDir), "delete operation failed —directory in use?"
-
- }
+ while (!deleted && !duration.limitExceeded) {
+ dfs.delete(path, true)
+ deleted = !dfs.exists(path)
+ if (!deleted) {
sleep(1000)
}
-
}
+ sliderFileSystem.verifyDirectoryNonexistent(path)
}
/**