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

TempResourceFile.Dispose causes run to hang #8

Closed
CharliePoole opened this issue Aug 15, 2016 · 3 comments
Closed

TempResourceFile.Dispose causes run to hang #8

CharliePoole opened this issue Aug 15, 2016 · 3 comments

Comments

@CharliePoole
Copy link
Collaborator

@CharliePoole commented on Tue Sep 29 2015

This Dispose method contains an infinite loop, exited via a break statement. Sometimes, when all other threads are also waiting, the exit requirements are never met.

Someone needs to examine the reasons behind the logic that is there and modify it so it doesn't hang.


@CharliePoole commented on Tue Sep 29 2015

I've noticed that this is often a problem when running a non-parallelizable STA test. Makes sense.

@tom-dudley
Copy link
Contributor

I can't wrap my head around why the loop would ever be infinite. It seems to me that GetDirectoryPath is guaranteed to either be null or empty once it hits the root node. I can only think that the function is somehow returning the path which was passed in, which is highly doubtful.

Why would a non-parallelizable STA test make this more likely?

@CharliePoole
Copy link
Collaborator Author

CharliePoole commented May 7, 2017

The comment about non-parallelizable STA tests relates to the original issue that was written against the framework. I suspected that the call to Delete might not return. However, it's irrelevant now that we are talking about the engine tests.

There may no longer be an issue. The only thing that bothers me about that method right now is the use of the name path for two purposes. It takes some knowledge of C# syntax to understand which value is being used in a given statement.

I think I'd be ready to close this in any case.

ChrisMaddock added a commit that referenced this issue Jul 31, 2017
@mikkelbu
Copy link
Member

I just looked a bit into this issue, as and I cannot see how the code could hang. The only problem I can see is that sometimes the Dispose will not remove the file/folder due to an exception being thrown, or possibly leaving empty folders behind if other threads/processes have a delete share to the file making the Delete method return before actually deleting the file (see e.g. https://stackoverflow.com/questions/50295265/file-exists-returns-true-after-file-delete).

@nunit/engine-team I propose to delete the class TempResourceFile since it is currently unused in the project.

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

No branches or pull requests

5 participants