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

Fails to delete .grunt/grunt-contrib-jasmine in teardown #58

Closed
reinseth opened this issue Apr 18, 2013 · 15 comments
Closed

Fails to delete .grunt/grunt-contrib-jasmine in teardown #58

reinseth opened this issue Apr 18, 2013 · 15 comments

Comments

@reinseth
Copy link

I've just started to experience this problem:
All specs passes just fine, but the teardown function in the jasmine-task fails with the following error message:

Fatal error: ENOTEMPTY, directory not empty 'C:\[...]\.grunt\grunt-contrib-jasmine

As you can see by that path, this is on a Windows machine (win7 64-bit, running node 0.8 64-bit).

The error occurs in the cleanTemp() function in tasks/lib/jasmine.js:

exports.cleanTemp = function() {
    rimraf.sync(tempDir);
  };

The problem seems to be the sync delete operation (tested with grunt.file.delete, which also fails btw). Converting it to a standard async operation (which rimraf encourages to use) solves the problem.

So I'm proposing to convert the teardown function to be async.

Note: I can't reproduce this bug with a simple, trivial example application, and I can't supply the sources of the project I'm working on (required confidentiality).

@jsoverson
Copy link
Member

That's a weird one, what is still in that directory if you dir it?

@reinseth
Copy link
Author

It's empty, every time the same.

@existentialism
Copy link
Contributor

@reinseth does the problem still happen with latest rimraf (2.1.4)?

@reinseth
Copy link
Author

reinseth commented May 7, 2013

Strangely, I cannot reproduce the error at all now (with the older rimraf). The only change I've made is rebooting the computer. So this might be some sort of a stability issue with windows/node, i don't know.

Close the issue, and I'll post back if it happens again.

@existentialism
Copy link
Contributor

Glad to hear it fixed itself! 👍

@jsoverson
Copy link
Member

Closing. Thanks for updating the issue, @reinseth and @existentialism.

@robdodson
Copy link

Having the same issue running the current version of grunt-contrib-jasmine. It's leaving behind an empty .grunt folder.

@reinseth
Copy link
Author

Can you test with rimraf 2.1.4 (as @existentialism suggested to me earlier)?

If that doesn't resolve the problem, then my proposed fix should be considered again.

@robdodson
Copy link

Rebooted and upgraded to rimraf 2.1.4 but neither fixed the issue.

Running osx 10.8.2, node 0.10.9, grunt-contrib-jasmine 0.4.2

@jsoverson
Copy link
Member

@robdodson can you see if there are any permissions issues that would prevent grunt from deleting that dir when you run it?

The directory ends up empty but remains? Or are there files in it?

@reinseth
Copy link
Author

reinseth commented Jun 3, 2013

Interesting that this is happing on a nix filesystems as well. As for permissions, I seriously doubt it to be that (when I changed the operation to async, the problem disappeared). It is more likely a locking problem.

This issue should be fixed as per my original suggestion.

@robdodson
Copy link

@jsoverson doesn't seem like a permission issue. It's in the same group and has all the same permissions as any other dir on my system. The directory doesn't have any files in it, it's just an empty .grunt dir.

@shama
Copy link
Member

shama commented Jun 7, 2013

This seems related to this issue: isaacs/rimraf#21 (look at this comment: isaacs/rimraf#19 (comment))

@jsoverson
Copy link
Member

@robdodson yeah, the solution would be to use @reinseth's original suggestion. I'll try to get this in soon. This module needs a new push and I've been slacking on it.

@jsoverson jsoverson reopened this Jun 7, 2013
@jsoverson
Copy link
Member

Updated rimraf, moved the deletion to the async method, and removed .grunt if it's empty. Hope this fixes any problems around this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants