Skip to content

Commit eaba2fd

Browse files
committed
Make the target-size grouping test robust to manifest size variation
The target was exactly twice the first manifest's length, so a second manifest one byte larger started its own group and the test was flaky.
1 parent 8138c67 commit eaba2fd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/table/test_rewrite_manifests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ def test_rewrite_manifests_single_manifest_is_noop(catalog: Catalog) -> None:
119119

120120
def test_rewrite_manifests_respects_target_size(catalog: Catalog) -> None:
121121
table = _create_table_with_appends(catalog, appends=4)
122-
manifest_length = _data_manifests(table)[0].manifest_length
122+
max_manifest_length = max(m.manifest_length for m in _data_manifests(table))
123123

124-
# allow roughly two source manifests per group
124+
# allow two source manifests per group (2x fits, 3x exceeds), robust to small size variations
125125
with table.transaction() as tx:
126-
tx.set_properties({"commit.manifest.target-size-bytes": str(manifest_length * 2)})
126+
tx.set_properties({"commit.manifest.target-size-bytes": str(int(max_manifest_length * 2.5))})
127127

128128
table = catalog.load_table("default.test_rewrite")
129129
table.maintenance.rewrite_manifests().commit()

0 commit comments

Comments
 (0)