Skip to content

Commit b88d993

Browse files
fix(tests): deflake blend order-independence - share one shell across roots
test_blend_corroboration_math built the primary docx shell once per order root via python-docx, whose zip carries wall-clock timestamps at 2-second DOS resolution: two builds straddling a tick yield different shell bytes, a different provenance.shell.sha256, and a spurious byte-equality failure (observed once locally and once on CI 3.10). The shell is now built once and shared by both roots, so the comparison isolates exactly what it pins: the commutativity of the blend. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 82f4767 commit b88d993

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

tests/test_profile_blend.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,13 +425,23 @@ def donor() -> dict:
425425
# produces byte-identical profile.json (commutative corroboration).
426426
# Each order runs in its own root with the SAME profile name and the
427427
# donors keep their own stable filenames (both are recorded facts).
428+
# The primary SHELL is built once and shared by both roots: a docx
429+
# saved by python-docx carries wall-clock zip timestamps (2-second DOS
430+
# resolution), so two separate builds straddling a tick would differ
431+
# in provenance.shell.sha256 and flake the byte-equality below.
428432
donor_a = (b"donor-bytes-a", "a.docx")
429433
donor_b = (b"donor-bytes-b", "b.docx")
434+
shared_shell = _shell_bytes()
430435
outputs = []
431436
for sub, order in (("ab", (donor_a, donor_b)), ("ba", (donor_b, donor_a))):
432437
root = self.tmp / f"order-{sub}"
433438
root.mkdir()
434-
_primary(root, name="order", roles=copy.deepcopy(donor_roles))
439+
_primary(
440+
root,
441+
name="order",
442+
roles=copy.deepcopy(donor_roles),
443+
shell=shared_shell,
444+
)
435445
for payload, filename in order:
436446
loaded = store.load_profile("order", "project", cwd=root)
437447
result = blend_mod.blend(loaded, donor(), payload, filename)

0 commit comments

Comments
 (0)