Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retry rmdir a few times #237

Merged
merged 1 commit into from Jan 17, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 20 additions & 2 deletions spec/acceptance/test_spec.js
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);
});