Skip to content

Make the bad read-back test always differ - #80

Merged
gahingwoo merged 1 commit into
mainfrom
fix/flaky-readback-test
Oct 30, 2026
Merged

gahingwoo merged 1 commit into
mainfrom
fix/flaky-readback-test

Conversation

@gahingwoo

Copy link
Copy Markdown
Owner

The ubuntu-22.04 smoke test on #79 failed with:

bad read-back ran ['db', 'rfi', 'wl', 'rl', 'rd'], failed 1
too-big image ran ['db', 'rfi'], failed 2

Cause: check_production_line fakes a bad read-back by replacing the image's last byte with 0x01. The image ends in os.urandom(5000), so 1 time in 256 that byte already is 0x01. The read-back then matches and the board passes. The second line follows from the first, since the failure count is one short. The production code is fine.

Fix: flip the last byte (^ 0xFF), so the read-back always differs.

I checked the other tests that modify random data: data[100] set to 0x00 expects "no filler" either way, and the 0xCC case would need a random 512-byte block of 0xCC. Neither can flake like this.

The production line test changed the image's last byte to 0x01 to fake a
bad read-back, but the image ends in random bytes: 1 time in 256 the
byte already was 0x01, the read-back matched and the board passed. That
failed the Ubuntu 22.04 run on #79. Flip the byte instead.
@gahingwoo
gahingwoo merged commit 18c4ce8 into main Oct 30, 2026
5 checks passed
@gahingwoo
gahingwoo deleted the fix/flaky-readback-test branch October 30, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant