Repository navigation
Fix Windows nightly test race: unique temp files for OpenSwathWorkflow_17_cache - #9937
Conversation
…wn temp output files TOPP_OpenSwathWorkflow_17 and TOPP_OpenSwathWorkflow_17_cache wrote to the exact same temp output paths (OpenSwathWorkflow_17.tmp.featureXML and OpenSwathWorkflow_17.chrom.tmp.mzML). ctest --parallel runs the two independent tests concurrently, and Windows enforces exclusive file locks (unlike POSIX), so one process's CreateFile call fails while the other still holds the file open: Cannot write output file given from parameter '-out_features'! Error: Unable to write file (... OpenSwathWorkflow_17.tmp.featureXML could not be created.) This is what failed TOPP_OpenSwathWorkflow_17_cache in the 2026-08-20 nightly Windows build. The sibling _b variant already avoids this by using its own unique output filenames; give the _cache variant the same treatment.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe cached ChangesOpenSwathWorkflow cache test
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…e fix (#9942) Documents three merged CI-reliability PRs that were missing changelog entries: the ccache build-cache save/restore split (#9887), pinning ruff for doc-validate (#9906), and the Windows nightly test race in TOPP_OpenSwathWorkflow_17_cache (#9937). Co-authored-by: Claude <[email protected]>
Description
The nightly Windows CI build failed on 2026-08-20 (run 32321896643) with:
The two tests genuinely race
TOPP_OpenSwathWorkflow_17andTOPP_OpenSwathWorkflow_17_cache(
src/tests/topp/CMakeLists.txt) are independentadd_test()entries with noDEPENDSrelationship, yet both pass the exact same-out_chrom/-out_featurestemp paths (
OpenSwathWorkflow_17.chrom.tmp.mzML/OpenSwathWorkflow_17.tmp.featureXML). CI runsctest --parallel, and the logshows the two launched back to back and overlapping:
_cachedied 0.13 s in while_17was still running.What actually caused the abort
Not a file lock, and not Windows-specific. The failure came from the startup
writability check —
TOPPBase::outputFileWritable_→File::writable— beforeeither tool had opened its real output.
File::writable()had two defects:syscalls (
fs::existsthenaccess/_access_s).access()already reportsENOENT, so theexists()call added no information — only a window in whichanother process could change the path between the two queries.
truncating
ofstreamand then unlinking it. Nothing established that the callhad created the file, so a probe could delete output another process had just
written under that name.
Two concurrent probes of one new path therefore lost the race and reported a
perfectly writable path as unwritable, which
outputFileWritable_turns intoUnableToCreateFile. Measured on Linux, that happened in ~2% of attempts, andthe destructive variant destroyed a concurrent writer's output in ~79% — so this
was never a Windows-only phenomenon; Windows simply has a wider window.
That is fixed in
File::writable()itself, in a separate change, not here.It matters because the same trap applies to any two TOPP tools pointed at one
output path — there are 7 such collisions in
src/tests/topp/CMakeLists.txt,of which this PR addresses one.
What this PR does fix: a silent coverage hole
The same CI run shows
TOPP_OpenSwathWorkflow_17_cachefailing and writingnothing, while
TOPP_OpenSwathWorkflow_17_cache_out1and_out2bothpassed:
They passed because they diffed
TOPP_OpenSwathWorkflow_17's output — the samefile. CTest's
DEPENDSonly orders tests; it does not gate them on thedependency succeeding. So the cache-mode comparisons were never asserting
anything about cache mode whenever the non-cache run wrote last.
This PR gives the
_cachevariant its own output names —OpenSwathWorkflow_17_cache.chrom.tmp.mzML/OpenSwathWorkflow_17_cache.tmp.featureXML— matching what the sibling_bvariant already does, and points
_cache_out1/_out2at them. They are stilldiffed against the same reference files, since caching mode is expected to
produce equivalent results to the in-memory run.
So this is not "no test behavior/coverage changes", as previously stated: it
converts two vacuous comparisons into real ones. Green CI on this branch is the
first actual evidence that cache-mode output matches the reference.
Checklist
Note on verification
The TOPP tests themselves have still not been run locally for this change: the
analysis above was done against a build configured with
BUILD_TOPP_TOOLS=OFF,which does not register
TOPP_OpenSwathWorkflow_17*. What is verified is the CIrun on this branch, which is green on
build-and-test (windows-2025, cl.exe)—and since
_cache_out1/_out2now read the cache run's own output rather thanthe non-cache run's, that green is meaningful in a way it was not before.
Summary by CodeRabbit