From 631c9fa5482ffed5ac6987aa78cd1176374be01c Mon Sep 17 00:00:00 2001 From: Joseph Marrero Date: Fri, 6 Nov 2026 15:58:13 +0000 Subject: [PATCH] tests: Cap oci-delta's bsdiff size in the switch-from-delta test On composefs UKI, plan-51-switch-from-delta can fail with oci-delta create "terminated by SIGKILL": bsdiff on the rebuilt ~120 MiB UKI (under the default 192 MiB cap) takes oci-delta to 2.3 GiB or more, and the kernel OOM-kills it in the 4G test VM. Capping bsdiff at 64 MiB sends the UKI through rollsums instead. Peak memory drops to about 130 MiB and the delta stays about the same size, so the test still applies a real binary delta. Generated-by: AI Signed-off-by: Joseph Marrero Corchado --- tmt/tests/booted/test-switch-from-delta.nu | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tmt/tests/booted/test-switch-from-delta.nu b/tmt/tests/booted/test-switch-from-delta.nu index 72198868f3..680fbd19c0 100644 --- a/tmt/tests/booted/test-switch-from-delta.nu +++ b/tmt/tests/booted/test-switch-from-delta.nu @@ -22,6 +22,8 @@ const image = "localhost/bootc-delta-target:latest" const delta = "/var/tmp/image-1-to-2.oci-delta" const state = "/var/tmp/bootc-delta-state.json" const marker = "/usr/share/testing-bootc-delta" +# Largest file (in MiB) oci-delta diffs with bsdiff; see initial_build +const max_bsdiff_mib = 64 def initial_build [] { tap begin "switch from OCI delta" @@ -56,7 +58,9 @@ def initial_build [] { let reference = $"localhost/bootc-delta-target@($target.Digest)" assert ($target.Digest != $st.status.booted.image.imageDigest) - oci-delta create $"oci-archive:($source_archive)" $"containers-storage:($image)" $delta + # bsdiff needs ~16 bytes of memory per byte of the old file; the ~120 MiB + # UKI (under oci-delta's default 192 MiB cap) got it OOM killed in the 4G VM. + oci-delta create --max-bsdiff-size $max_bsdiff_mib $"oci-archive:($source_archive)" $"containers-storage:($image)" $delta # Keep the target available only through the delta. podman rmi $image