On Windows CI (x86_64-windows-debug), the run_output_caching test
intermittently fails because CheckFile reads an empty file. The child
process writes via writeStreamingAll which completes the NtWriteFile
syscall synchronously, but the data can remain in the filesystem cache
and not be visible to other processes reading the file by path —
especially under conditions like antivirus scanning or heavy I/O.
Adding file.sync(io) after writeStreamingAll forces NtFlushBuffersFile,
ensuring the written data is committed to disk before the process exits.
Contributed with ♥ by SB0 LTD
On Windows CI (x86_64-windows-debug), the run_output_caching test
intermittently fails because CheckFile reads an empty file. The child
process writes via writeStreamingAll which completes the NtWriteFile
syscall synchronously, but the data can remain in the filesystem cache
and not be visible to other processes reading the file by path —
especially under conditions like antivirus scanning or heavy I/O.
Adding file.sync(io) after writeStreamingAll forces NtFlushBuffersFile,
ensuring the written data is committed to disk before the process exits.
Contributed with ♥ by [SB0 LTD](https://sb0.tech)