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

Make symlink optional to fix tests on Windows #1600

Merged
merged 5 commits into from
Feb 22, 2021
Merged

Conversation

dagewa
Copy link
Member

@dagewa dagewa commented Feb 19, 2021

This allows all tests in test_import.py to pass on Windows even without Administrator access, or Developer Mode.

Emit a warning when this happens, with information about how to
enable symlinking (on Windows).
@codecov
Copy link

codecov bot commented Feb 19, 2021

Codecov Report

Merging #1600 (0add29b) into master (a682cc8) will increase coverage by 0.01%.
The diff coverage is 75.00%.

@@            Coverage Diff             @@
##           master    #1600      +/-   ##
==========================================
+ Coverage   66.62%   66.64%   +0.01%     
==========================================
  Files         614      614              
  Lines       68725    68763      +38     
  Branches     9567     9577      +10     
==========================================
+ Hits        45789    45824      +35     
- Misses      21007    21010       +3     
  Partials     1929     1929              

and don't generate warnings
@Anthchirp Anthchirp merged commit dd72343 into master Feb 22, 2021
@Anthchirp Anthchirp deleted the optional-symlink branch February 22, 2021 08:34
shutil.copy(image, tmp_path)
yield tmp_path.joinpath("centroid_####.cbf")
for image in images:
(tmp_path / image.basename).unlink()
Copy link
Member Author

@dagewa dagewa Feb 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unlink line gave

E           PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\fcx32934\\AppData\\Local\\Temp\\pytest-of-fcx32934\\pytest-67\\popen-gw9\\test_template_with_missing_ima1\\centroid_0005.cbf'

in my Windows test run.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like an intermittent error. Something like Windows file locking at play, perhaps

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix incoming

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this is us not correctly dealing with file handles (ie. not using context handlers everywhere), leading to a race against the garbage collection.

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

Successfully merging this pull request may close these issues.

None yet

3 participants