Skip to content

Fix temp file race on Windows and show failures logs in CI - #32

Merged
tbybell merged 3 commits into
gtkwave:mainfrom
Rodrigodd:upstream/windows-tmpfile-race
Oct 18, 2026
Merged

tbybell merged 3 commits into
gtkwave:mainfrom
Rodrigodd:upstream/windows-tmpfile-race

Conversation

@Rodrigodd

Copy link
Copy Markdown
Contributor

Hopefully, this fixes the CI failure seen in #30 (comment).

Ideally, the temporary file should have a non-predictable unique filename. I tried to implement that, but it seemed non-trivial, and I don't have a Windows machine to test it on, so I dropped it.

I also changed the CI configuration to display test failures and upload Meson logs on failure, so it is easier to debug CI failures in the future.

Rodrigodd and others added 3 commits October 17, 2026 18:30
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.
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
@tbybell
tbybell merged commit a27931b into gtkwave:main Oct 18, 2026
3 checks passed
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.

2 participants