Make kes_bytes file creation/write atomic for concurrent access#3353
Open
turmelclem wants to merge 2 commits into
Open
Make kes_bytes file creation/write atomic for concurrent access#3353turmelclem wants to merge 2 commits into
turmelclem wants to merge 2 commits into
Conversation
c5f9f45 to
c027a80
Compare
Test Results 5 files ± 0 206 suites ±0 56m 22s ⏱️ - 2h 11m 49s Results for commit f3cd375. ± Comparison against base commit 5d25797. This pull request removes 73 and adds 1 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
c6318c7 to
08b4c2d
Compare
08b4c2d to
4262b67
Compare
4262b67 to
0190334
Compare
55ed003 to
5d72cad
Compare
4e8a8ce to
a422c8b
Compare
9f53972 to
c2f7289
Compare
There was a problem hiding this comment.
Pull request overview
This PR aims to eliminate CI flakiness caused by concurrent tests reading partially-written kes_bytes/Shelley-format files by switching test file exports to an atomic write pattern (write to a uniquely-named temp file, then rename into place).
Changes:
- Introduces a test-only
SerDeShelleyFileFormatTestExtension::to_fileto separate file-export helpers from the coreSerDeShelleyFileFormattrait. - Updates test/fixture code to use the new
to_fileextension trait. - Implements an atomic-write strategy for
to_file(temp file + rename) and adds a regression test ensuring a single final file is produced.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| mithril-common/src/test/crypto_helper/cardano/kes/setup.rs | Switches test KES material generation to use the new to_file test extension trait. |
| mithril-common/src/test/crypto_helper/cardano/extensions.rs | Adds a test-only extension trait to expose to_file for Shelley-format exports. |
| mithril-common/src/test/builder/fixture_builder.rs | Updates fixture builder imports/usage to rely on the new to_file extension trait. |
| mithril-common/src/crypto_helper/mod.rs | Re-exports CodecParseError to support the new extension trait signature. |
| mithril-common/src/crypto_helper/cardano/opcert.rs | Updates tests to import the to_file extension trait. |
| mithril-common/src/crypto_helper/cardano/codec.rs | Moves to_file behind a test extension trait and changes it to an atomic temp-write + rename approach; adds a regression test. |
Alenar
approved these changes
Jun 26, 2026
c2f7289 to
7179ff7
Compare
* mithril-common from `0.7.8` to `0.7.9`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Content
Make kes_bytes file creation/write atomic for concurrent access, especially to fix CI test flakiness
Pre-submit checklist
Issue(s)
this PR closes #3329