Skip to content

Cache readonly improvements - #10007

Merged
pllim merged 6 commits into
astropy:masterfrom
aarchiba:cache-readonly-improvements
Mar 4, 2020
Merged

pllim merged 6 commits into
astropy:masterfrom
aarchiba:cache-readonly-improvements

Conversation

@aarchiba

@aarchiba aarchiba commented Mar 4, 2020 •

Copy link
Copy Markdown
Contributor

Fixes #10003

Description

This pull request is to address the cache code's failure to recognize read-only filesystems as being read-only (rather than generically broken).

aarchiba added 2 commits March 4, 2020 15:07
The mystery segfault may be related to bug astropy#9699?
Read-only filesystems do not raise PermissionError; handle this case
too.
The segfault does not appear to be part of astropy but the test suite
triggers it if not modified; this skips those tests but leaves them in
place.

The skipped tests basically exist to allow the coverage tools to work on
the lock-contention code - the multiprocessing version does test out the
capabilities but the coverage tools don't work with multiprocessing.
@aarchiba

aarchiba commented Mar 4, 2020

Copy link
Copy Markdown
Contributor Author

Sorry for lumping the segfault fix in with the readonly fix but I couldn't even run the test suite without the segfault fix.

@dstndstn

dstndstn commented Mar 4, 2020

Copy link
Copy Markdown

I confirm that this fixes #10003

@pllim

pllim commented Mar 4, 2020

Copy link
Copy Markdown
Member

Yay, thanks, everyone! @aarchiba , please let me know when this is ready for a final review.

@pllim pllim added the Bug label Mar 4, 2020
@pllim pllim added this to the v4.0.1 milestone Mar 4, 2020
@pllim

pllim commented Mar 4, 2020

Copy link
Copy Markdown
Member

I am tentatively slating this for 4.0.1 with the possibility of it slipping to 4.0.2 if needed.

@aarchiba

aarchiba commented Mar 4, 2020

Copy link
Copy Markdown
Contributor Author

I think it's good to go. Let me know if you want me to squash it but maybe it can wait until I fix the mistakes review catches.

@pllim pllim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you! Just a minor comment on the skipped tests.

@bsipocz , can I ignore the coverage failures?

Comment thread astropy/utils/tests/test_data.py Outdated
assert is_url_in_cache(u)


@pytest.mark.skip(reason="causes mystery segfault! possibly bug #10008")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we do a skipif so this runs for Python 3.8+? Same comment for all the other similar skips.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Python 3.6 seems to be fine too.

The point of these tests was to ensure that the locking code got registered by the coverage tools - there are multiprocessing-based tests that explore a variety of concurrent paths through the locking code but the subprocesses don't show on the coverage, so I ran some thread-based tests instead to check all my branches were covered. So with the thread-based tests disabled the coverage tools will see less, even apart from the code that's skipped. Conditional skipping should help a little.

@pllim pllim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! And I don't think this needs squashing. Thanks again.

@pllim
pllim merged commit 3c88b57 into astropy:master Mar 4, 2020
@bsipocz

bsipocz commented Mar 4, 2020

Copy link
Copy Markdown
Member

4.0.1 is perfectly fine, I was actually hoping to get these fixes in.

bsipocz pushed a commit that referenced this pull request Mar 17, 2020
bsipocz pushed a commit that referenced this pull request Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cache directory on read-only filesystem

4 participants