From 1a655b0cbebd0078a1ff367169a75fd52d9b6154 Mon Sep 17 00:00:00 2001 From: alanning Date: Thu, 16 Jan 2014 23:52:12 -0500 Subject: [PATCH 1/2] ignore swp files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7e287dc..81018e6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ spec/support/cache spec/var .DS_Store npm-debug.log +*.swp From 7a41325e14ff8aa13e30922f7e9ce93869731677 Mon Sep 17 00:00:00 2001 From: alanning Date: Thu, 16 Jan 2014 23:52:53 -0500 Subject: [PATCH 2/2] retry rmdir a few times --- spec/acceptance/test_spec.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/spec/acceptance/test_spec.js b/spec/acceptance/test_spec.js index fdee95b..e09494f 100644 --- a/spec/acceptance/test_spec.js +++ b/spec/acceptance/test_spec.js @@ -41,7 +41,25 @@ before(function(done){ beforeEach(function() { // clear out the fake home directory - if (fs.existsSync(appHome)) - wrench.rmdirSyncRecursive(appHome); + if (fs.existsSync(appHome)) { + // XXX: this is really nasty but it appears some process is not releasing + // files in time so sometimes this call fails with ENOTEMPTY: + // + // https://github.com/oortcloud/meteorite/issues/235 + // + // Retrying a couple of times seems to work. Real solution is to figure + // out why process isn't being killed. + try { + wrench.rmdirSyncRecursive(appHome); + } + catch (ex) { + try { + wrench.rmdirSyncRecursive(appHome); + } + catch (ex2) { + wrench.rmdirSyncRecursive(appHome); + } + } + } fs.mkdirSync(appHome); });