Skip to content

Commit 60ff5ec

Browse files
authored
fix preview2_stdin test on Asahi Linux (#13126)
This has test has been failing on my Asahi Ubuntu Linux (ARM64) machine since the first time I ran it, but I never got around to actually addressing it until now. Seems that the `slop` factor in this test was just _one_ byte too small. Not sure why this never broke on CI; might be specific to Apple hardware, e.g. 16K page sizes.
1 parent afacb4a commit 60ff5ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/all/cli_tests.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,10 @@ fn preview2_stdin() -> Result<()> {
10441044
// helper thread depends on how much the OS buffers for us. For now give
10451045
// some some slop and assume that OSes are unlikely to buffer more than
10461046
// that.
1047-
let slop = 256 * 1024;
1047+
//
1048+
// Note that 256 * 1024 is _one_ byte too small on Asahi Linux (possibly
1049+
// related to 16K page sizes?), hence the `+ 1` here:
1050+
let slop = 256 * 1024 + 1;
10481051
for amt in [0, 100, 100_000] {
10491052
let written = count_up_to(amt)?;
10501053
assert!(written < slop + amt, "wrote too much {written}");

0 commit comments

Comments
 (0)