Skip to content

Commit

Permalink
Merge pull request #237 from oortcloud/235b-retry-rmdir
Browse files Browse the repository at this point in the history
retry rmdir a few times
  • Loading branch information
tmeasday committed Jan 17, 2014
2 parents 1a655b0 + 7a41325 commit 85ee7e3
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions spec/acceptance/test_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

0 comments on commit 85ee7e3

Please sign in to comment.