-
Notifications
You must be signed in to change notification settings - Fork 217
Minor testing rework. #1184
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
Minor testing rework. #1184
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
This PR refactors test helper infrastructure following review feedback from PR #1176. The changes consolidate platform detection logic and libc loading into the shared cuda_python_test_helpers package, replacing repetitive conditional imports across test modules with centralized utilities. The cuda_core/tests/helpers/__init__.py now uses wildcard imports to automatically expose all test helper symbols (IS_WSL, IS_WINDOWS, supports_ipc_mempool, libc) without manual re-exports. The buffers.py module removes inline platform-specific ctypes CDLL loading in favor of importing the shared libc object. Additionally, the latch kernel's nanosleep interval is reduced from 10ms to 1ms to improve test responsiveness. These changes align with the broader testing infrastructure improvements for IPC-enabled events, promoting DRY principles and reducing maintenance burden.
Confidence score: 1/5
- This PR has critical bugs that will cause immediate test failures if merged
- Score reflects a critical initialization order bug in
latch.pyline 63 (accessingself.busy_wait_flag[0]beforeself.buffer.handleandself.timeout_cyclesare fully initialized), incorrect libc loading that hardcodeslibc.so.6(breaking macOS/non-Linux platforms), and inefficient conditional logic insupports_ipc_mempoolthat calls_detect_wsl()instead of using the already-computedIS_WSLconstant - Pay extremely close attention to
cuda_core/tests/helpers/latch.pylines 61-65 (initialization order),cuda_python_test_helpers/cuda_python_test_helpers/__init__.pylines 31-36 (platform-specific libc loading), and line 47 (redundant WSL detection)
Additional Comments (1)
-
cuda_core/tests/helpers/latch.py, line 63 (link)logic: accessing
busy_wait_flagproperty beforetimeout_cyclesis set will cause AttributeErrorMove line 65 above line63to ensure
timeout_cyclesexists before any property access.
4 files reviewed, 1 comment
07a9450 to
e4f4efd
Compare
|
|
||
| try: | ||
| import cuda_python_test_helpers | ||
| from cuda_python_test_helpers import * # noqa: F403 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good place to use import *, since we are trying to merge modules defined in different places, we control both, and the source has an __all__ list.
e4f4efd to
87e93c4
Compare
87e93c4 to
5cb98ae
Compare
|
/ok to test |
@Andy-Jost, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/ |
|
/ok to test 5cb98ae |
This comment has been minimized.
This comment has been minimized.
|
Follow-on changes to #1176 based on review feedback.