You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix SharedTensor anti-pattern in multiprocess tests
Fixed tests that were using the anti-pattern:
SharedTensor(handle=handle).tensor
This pattern creates a dangling tensor reference because the SharedTensor
object is immediately garbage collected, causing __del__ to close the
shared memory, which invalidates the tensor reference.
Changed all multiprocess worker functions to use context managers:
- test_multiprocess_read
- test_multiprocess_write
- test_multiprocess_bidirectional
- test_to_shared_tensor_multiprocess
- test_multiple_receivers_close_independently
Test plan:
- All 65 tests now pass (previously 1 segfault)
- python -m pytest tests/unit_tests/util/test_shared_tensor.py -v
0 commit comments