Skip to content

fix: don't overwrite recordings saved in the same second - #318

Merged
FalkWoldmann merged 1 commit into
masterfrom
fix-recording-doctest-race
Sep 30, 2026
Merged

FalkWoldmann merged 1 commit into
masterfrom
fix-recording-doctest-race

Conversation

@FalkWoldmann

@FalkWoldmann FalkWoldmann commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Recording::save_to names files <scenario>_<unix seconds>.yaml and opened them with File::create, so two saves of the same scenario within a second overwrote each other. The record, playback and playback_async doctests all save my_test_scenario and run in parallel, so one could read a file another was rewriting and panic with "Cannot deserialize mock server response". That's the flaky Test (all-features) failure seen on #317.

The file is now created with File::create_new; if the name is taken, a counter is appended (<scenario>_<ts>_1.yaml, ...). The usual filename is unchanged.

Added a test that saves the same scenario twice; it fails without the fix. The full doctest run passed 5 times in a row with --features standalone, which failed on the first try before.

Closes #219

@danieleades

Copy link
Copy Markdown
Contributor

also resolves this issue: #219 (comment)

@FalkWoldmann
FalkWoldmann force-pushed the fix-recording-doctest-race branch from 4eab6b8 to af312d8 Compare September 30, 2026 19:44
@FalkWoldmann
FalkWoldmann merged commit 9c5c148 into master Sep 30, 2026
15 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.

Improve CI/CD Pipelines

2 participants