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

Fix the pytest error for async io #559

Conversation

kingcrimsontianyu
Copy link
Contributor

@kingcrimsontianyu kingcrimsontianyu commented Nov 20, 2024

This PR fixes #558

The root cause is that POSIX and cuFile report different error messages for the same invalid operation which attempts to read from a write-only file. The unit test needs to take account of these different messages.

@kingcrimsontianyu kingcrimsontianyu self-assigned this Nov 20, 2024
@kingcrimsontianyu kingcrimsontianyu added non-breaking Introduces a non-breaking change python Affects the Python API of KvikIO bug Something isn't working labels Nov 20, 2024
@kingcrimsontianyu kingcrimsontianyu marked this pull request as ready for review November 20, 2024 20:13
@kingcrimsontianyu kingcrimsontianyu requested a review from a team as a code owner November 20, 2024 20:13
# Try to read file opened in write-only mode
with pytest.raises(RuntimeError, match="Operation not permitted"):
with pytest.raises(RuntimeError, match=expected_except_msg):
Copy link
Contributor

Choose a reason for hiding this comment

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

not a big fan of tests that check the error message content, but that's not on this PR.

Copy link
Contributor

@bdice bdice Nov 20, 2024

Choose a reason for hiding this comment

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

It seems like we're adding a lot of APIs (some public?) just for this error. Can we instead just verify that the error matches one of these strings, without worrying about which one? That would let us remove all the is_compat_mode_preferred logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense. I'm wondering if ideally the public function is_compat_mode_preferred() and is_compat_mode_preferred_for_async() should be included in the Python API, or are they considered too low-level?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Python API addition has been reverted for now.

@kingcrimsontianyu kingcrimsontianyu changed the base branch from branch-25.02 to branch-24.12 November 20, 2024 23:44
@kingcrimsontianyu kingcrimsontianyu requested review from a team as code owners November 20, 2024 23:44
@kingcrimsontianyu kingcrimsontianyu marked this pull request as draft November 20, 2024 23:45
@kingcrimsontianyu kingcrimsontianyu force-pushed the fix-cufile-unit-test-failure branch from c661e9d to 2ccd3f8 Compare November 21, 2024 00:02
@vuule vuule marked this pull request as ready for review November 21, 2024 02:25
@vuule vuule requested a review from madsbk November 21, 2024 02:28
Copy link
Member

@madsbk madsbk left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @kingcrimsontianyu

@madsbk
Copy link
Member

madsbk commented Nov 21, 2024

/merge

@rapids-bot rapids-bot bot merged commit b0e7bd1 into rapidsai:branch-24.12 Nov 21, 2024
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working non-breaking Introduces a non-breaking change python Affects the Python API of KvikIO
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python test_async_io fails on GDS-enabled system
4 participants