Skip to content

Fix Windows nightly test race: unique temp files for OpenSwathWorkflow_17_cache - #9937

Merged
timosachsenberg merged 1 commit into
developfrom
claude/laughing-wozniak-iylrdz
Aug 21, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
claude/laughing-wozniak-iylrdz

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

The nightly Windows CI build failed on 2026-08-20 (run 32321896643) with:

2027/2800 Test #2027: TOPP_OpenSwathWorkflow_17_cache ...***Failed  0.13 sec
Cannot write output file given from parameter '-out_features'!
Error: Unable to write file (the file
'D:/a/OpenMS/OpenMS/build/src/tests/topp/tmp_path/OpenSwathWorkflow_17.tmp.featureXML'
could not be created. )

Note: an earlier version of this description attributed the abort to Windows
exclusive file locks defeating a second CreateFile. That was wrong. The real
mechanism is described under "What actually caused the abort" below, and it is
fixed elsewhere — not by this PR.

The two tests genuinely race

TOPP_OpenSwathWorkflow_17 and TOPP_OpenSwathWorkflow_17_cache
(src/tests/topp/CMakeLists.txt) are independent add_test() entries with no
DEPENDS relationship, yet both pass the exact same -out_chrom/-out_features
temp paths (OpenSwathWorkflow_17.chrom.tmp.mzML /
OpenSwathWorkflow_17.tmp.featureXML). CI runs ctest --parallel, and the log
shows the two launched back to back and overlapping:

          Start 2024: TOPP_OpenSwathWorkflow_17
          Start 2027: TOPP_OpenSwathWorkflow_17_cache
 583/2800 Test #2027: TOPP_OpenSwathWorkflow_17_cache ...***Failed  0.13 sec
 584/2800 Test #2024: TOPP_OpenSwathWorkflow_17 .........   Passed  0.46 sec

_cache died 0.13 s in while _17 was 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 — before
either tool had opened its real output. File::writable() had two defects:

  1. It asked "does the path exist?" and "may I write it?" as two separate
    syscalls (fs::exists then access/_access_s). access() already reports
    ENOENT, so the exists() call added no information — only a window in which
    another process could change the path between the two queries.
  2. For a path that did not exist it probed by opening that very path with a
    truncating ofstream and then unlinking it. Nothing established that the call
    had 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 into
UnableToCreateFile. Measured on Linux, that happened in ~2% of attempts, and
the 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_cache failing and writing
nothing
, while TOPP_OpenSwathWorkflow_17_cache_out1 and _out2 both
passed:

 583/2800 Test #2027: TOPP_OpenSwathWorkflow_17_cache .......***Failed  0.13 sec
2344/2800 Test #2028: TOPP_OpenSwathWorkflow_17_cache_out1 ...  Passed  0.07 sec
2346/2800 Test #2029: TOPP_OpenSwathWorkflow_17_cache_out2 ...  Passed  0.08 sec

They passed because they diffed TOPP_OpenSwathWorkflow_17's output — the same
file. CTest's DEPENDS only orders tests; it does not gate them on the
dependency succeeding. So the cache-mode comparisons were never asserting
anything about cache mode whenever the non-cache run wrote last.

This PR gives the _cache variant its own output names —
OpenSwathWorkflow_17_cache.chrom.tmp.mzML /
OpenSwathWorkflow_17_cache.tmp.featureXML — matching what the sibling _b
variant already does, and points _cache_out1/_out2 at them. They are still
diffed 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

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file (test-only change)
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes — see note below
  • Updated or added python bindings for changed or new classes (not applicable, test-only change)

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 CI
run on this branch, which is green on build-and-test (windows-2025, cl.exe) —
and since _cache_out1/_out2 now read the cache run's own output rather than
the non-cache run's, that green is meaningful in a way it was not before.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed ion-mobility cache test output handling by using distinct filenames for chromatogram and featureXML results.
    • Updated comparison checks to reference the correct cache-specific outputs.

…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.
@coderabbitai

coderabbitai Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 171960d2-6829-4df7-ab25-e7ab7928e619

📥 Commits

Reviewing files that changed from the base of the PR and between 385155f and 8df79a3.

📒 Files selected for processing (1)
  • src/tests/topp/CMakeLists.txt

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The cached OpenSwathWorkflow_17 test now uses dedicated chromatogram and featureXML output filenames. Comparison tests read these cache-specific files instead of the non-cache outputs.

Changes

OpenSwathWorkflow cache test

Layer / File(s) Summary
Separate cached test outputs
src/tests/topp/CMakeLists.txt
The cached workflow uses dedicated OpenSwathWorkflow_17_cache filenames for chromatogram and featureXML outputs. Comparison tests use the renamed files.

Suggested reviewers: singjc, copilot, jonasscheid

Poem

A rabbit checks the cache with care,
Two fresh file names now wait there.
Chromatograms hop in line,
FeatureXML follows fine.
No test outputs cross the trail—
The burrowed build can now prevail!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the Windows test race and the unique temporary files used to fix it.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/laughing-wozniak-iylrdz

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@timosachsenberg
timosachsenberg merged commit a34540b into develop Aug 21, 2026
35 checks passed
@timosachsenberg
timosachsenberg deleted the claude/laughing-wozniak-iylrdz branch August 21, 2026 16:26
timosachsenberg added a commit that referenced this pull request Aug 22, 2026
…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]>
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