Skip to content

Commit 8c3c9e4

Browse files
jrbourbeauayushdg
andauthored
Fix flaky test_split_parquet_file_by_size failure (#1185)
* Log more info on test_split_parquet_file_by_size failure Signed-off-by: James Bourbeau <[email protected]> * Sort files Signed-off-by: James Bourbeau <[email protected]> --------- Signed-off-by: James Bourbeau <[email protected]> Co-authored-by: Ayush Dattagupta <[email protected]>
1 parent fd4b2f7 commit 8c3c9e4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/utils/test_split_large_files.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ def test_split_parquet_file_by_size(parquet_file_factory: Callable, tmp_path: pa
7676
pd.testing.assert_frame_equal(expected, result)
7777

7878
# Check that split data files have expected sizes
79-
sizes_mb = [pq.read_table(f).nbytes / (1024 * 1024) for f in outdir.rglob("*")]
79+
files = sorted(outdir.rglob("*"))
80+
sizes_mb = [pq.read_table(f).nbytes / (1024 * 1024) for f in files]
8081
# Below the target size
81-
assert all(s_mb < target_size_mb for s_mb in sizes_mb)
82+
assert all(s_mb < target_size_mb for s_mb in sizes_mb), (sizes_mb, files)
8283
# More than half the target (ignoring the last file, which can sometimes be small)
83-
assert all(s_mb > target_size_mb / 2 for s_mb in sizes_mb[:-1])
84+
assert all(s_mb > target_size_mb / 2 for s_mb in sizes_mb[:-1]), (sizes_mb, files)

0 commit comments

Comments
 (0)