From f79e804ddf440cbadbfe66e4a30a2c8487a60042 Mon Sep 17 00:00:00 2001 From: Rodrigo Batista de Moraes Date: Sat, 17 Oct 2026 17:48:18 -0300 Subject: [PATCH 1/2] Fix temporary file name race on Windows Problem: on MinGW, tmpfile_open() gets a name from GetTempFileName(), which creates an empty file to reserve it, and then deletes that file and creates it again with fopen(). Between the two another process calling GetTempFileName() at the same time can receive the same name, since the name is derived from the current system time, and both processes end up writing their temporary data into the same file. This happens when the tests run in parallel, where every test process creates its temporary files right as it starts, and shows up as a test failing at random on the Windows CI. Solution: open the file GetTempFileName() created, without deleting it first. --- src/fstapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fstapi.c b/src/fstapi.c index 15440f0..3c3c496 100644 --- a/src/fstapi.c +++ b/src/fstapi.c @@ -214,7 +214,7 @@ static FILE *tmpfile_open(char **nam) if (fname) { *nam = fname; - fh = unlink_fopen(fname, "w+b"); + fh = fopen(fname, "w+b"); } } From ff018a1928658e4b190d41d0aace69555f823f72 Mon Sep 17 00:00:00 2001 From: Rodrigo Batista de Moraes Date: Sat, 17 Oct 2026 17:48:29 -0300 Subject: [PATCH 2/2] Show test failure output on CI Problem: when a test fails on CI, the log only shows its name and exit status. What the test printed, such as which assertion failed, goes to build/meson-logs/testlog.txt, which is lost with the runner. Solution: run the tests with --print-errorlogs, so the output of failing tests is printed in the job log, and upload build/meson-logs/ as an artifact when a job fails. AI-assisted --- .github/workflows/ci.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 835db2b..61d01de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,13 @@ jobs: - name: Build library run: meson compile -C build/ - name: Run tests - run: meson test -C build/ + run: meson test -C build/ --print-errorlogs + - name: Upload test logs + if: failure() + uses: actions/upload-artifact@v4 + with: + name: meson-logs-linux + path: build/meson-logs/ build-macos: name: Build (macOS) @@ -39,7 +45,13 @@ jobs: - name: Build library run: meson compile -C build/ - name: Run tests - run: meson test -C build/ + run: meson test -C build/ --print-errorlogs + - name: Upload test logs + if: failure() + uses: actions/upload-artifact@v4 + with: + name: meson-logs-macos + path: build/meson-logs/ build-windows: name: Build (Windows MINGW64) @@ -64,4 +76,10 @@ jobs: - name: Build library run: meson compile -C build/ - name: Run tests - run: meson test -C build/ + run: meson test -C build/ --print-errorlogs + - name: Upload test logs + if: failure() + uses: actions/upload-artifact@v4 + with: + name: meson-logs-windows + path: build/meson-logs/