Skip to content

Commit 926b4e6

Browse files
authored
Backport test_cufile.py changes (from unreleased branch). (#783)
* Change test_batch_io_large_operations to avoid a flood of output (`assert read_data == expected_data` failure). * Remove `(scope="module")` from `cufile_env_json` fixture: resolves test_batch_io_large_operations failure.
1 parent f336027 commit 926b4e6

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

cuda_bindings/tests/test_cufile.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def platform_is_wsl():
4040
pytest.skip("skipping cuFile tests on WSL", allow_module_level=True)
4141

4242

43-
@pytest.fixture(scope="module")
43+
@pytest.fixture
4444
def cufile_env_json():
4545
"""Set CUFILE_ENV_PATH_JSON environment variable for async tests."""
4646
original_value = os.environ.get("CUFILE_ENV_PATH_JSON")
@@ -1573,7 +1573,14 @@ def test_batch_io_large_operations():
15731573
repetitions = buf_size // test_string_len
15741574
expected_data = (test_string * repetitions)[:buf_size]
15751575

1576-
assert read_data == expected_data, f"Read data doesn't match written data for operation {i}"
1576+
if read_data != expected_data:
1577+
n = 100 # Show first n bytes
1578+
raise RuntimeError(
1579+
f"Read data doesn't match written data for operation {i}: "
1580+
f"{len(read_data)=}, {len(expected_data)=}, "
1581+
f"first {n} bytes: read {read_data[:n]!r}, "
1582+
f"expected {expected_data[:n]!r}"
1583+
)
15771584

15781585
# Clean up batch IO
15791586
cufile.batch_io_destroy(batch_handle)

0 commit comments

Comments
 (0)