[php-src] PR #23717: Fix flaky CI timeout in bug81145.phpt by not copying 4 GB

From: Date: Thu, 17 Sep 2026 10:11:59 +0000
Subject: [php-src] PR #23717: Fix flaky CI timeout in bug81145.phpt by not copying 4 GB
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-38525@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/23717 Author: matthiasgoergens ext/standard/tests/file/bug81145.phpt is a flaky test on the Windows CI runners. It copies a whole 4 GB file, which took 28.2 s and 28.6 s in two runs where it passed ([master](https://github.com/php/php-src/actions/runs/35087720132/job/104766454955), [a pull request](https://github.com/php/php-src/actions/runs/31769103249/job/94671124087)), and in [this run](https://github.com/php/php-src/actions/runs/35086412968/job/104762218965) on #23269 it hit the 120 s test timeout on both attempts, failing an unrelated pull request. #15962 reports the same timeout under make test. This PR removes the cause rather than retrying: the new test never copies 4 GB, so it cannot time out. It can do that because the copy no longer tests what it was written for. [Bug #81145](https://bugs.php.net/bug.php?id=81145) was fixed in #7158 by correcting dwFileOffsetHigh in the memory mapping in plain_wrapper.c, but copy() and stream_copy_to_stream() now go through the fd-level copy in main/io and never map. fpassthru() still asks for a mapping from the current position, so seeking to exactly 4 GiB requests a mapping with a non-zero high offset word and exercises the fixed code whenever mapping succeeds. A 256-byte stream_copy_to_stream() at the same offset keeps the fd-level path covered. Both check a large offset, not a large transfer. The file is created sparse on Windows and with fallocate elsewhere; the test writes a 512-byte pattern across the boundary and reads back only the 256 bytes above it. Measured: on a GitHub-hosted windows-2025-vs2026 runner, using a workflow on my fork that runs only this test, the new test passes and run-tests reports 0.33 s for the selected test run ([run](https://github.com/matthiasgoergens/php-src/actions/runs/35174324346)). Another run on the same runner image, with the high offset word forced back to zero as it was before #7158, fails with Mapped copy failed ([run](https://github.com/matthiasgoergens/php-src/actions/runs/35174818170)), so the test still catches the bug it is named after. On Linux, run-tests reports 0.06 s for the test and strace shows mmap(NULL, 256, PROT_READ, MAP_SHARED, 5, 0x100000000).

« previous php.git-pulls (#38525) next »