Skip to content

Random test failures on windows after editing a python file #576

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

Closed
pytestbot opened this issue Sep 1, 2014 · 4 comments
Closed

Random test failures on windows after editing a python file #576

pytestbot opened this issue Sep 1, 2014 · 4 comments
Labels
platform: windows windows platform-specific problem type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: BitBucket: pombredanne, GitHub: pombredanne


I get random failures on windows only (not on mac and not on linux) with win7 and Python 2.7.8 and py.test 2.6.1.

This heisenbug occurs some times after editing a file and running py.test.
Somehow, I found that the previous version of the code was executed, not the one saved.
Clearing the pycache solved the issue each time.

I reckon that I could disable bytecode creation (as per #200 )
However why should I need to worry about a special python flag or env var just for py.test?

Note: the issue could be due to poor filesystem timestamps resolution on windows when files are updated.

Could it make sense to have a flag disable caching? or only enable caching with a command flag?


@pytestbot
Copy link
Contributor Author

Original comment by BitBucket: pombredanne, GitHub: pombredanne:


By the way, I do not know when Windows updates the modification time stamps in NTFS, but this is rather troubling:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724290%28v=vs.85%29.aspx

"The NTFS file system delays updates to the last access time for a file by up to 1 hour after the last access."

Otherwise, NTFS resolution is 100 nanosec.

@pytestbot
Copy link
Contributor Author

Original comment by Benjamin Peterson (BitBucket: gutworth, GitHub: gutworth):


Hopefully a433de9ca4f0 will help.

@pytestbot
Copy link
Contributor Author

Original comment by BitBucket: pombredanne, GitHub: pombredanne:


@gutworth thx++ ... let me test that. It can sure help
though I think that pycache should not be used on windows at all.
I will test and report1

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jun 15, 2015
@pfctdayelise pfctdayelise added the platform: windows windows platform-specific problem label Jul 25, 2015
@RonnyPfannschmidt
Copy link
Member

Closing as stalled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: windows windows platform-specific problem type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

3 participants