test: add deterministic crash checkpoints for installs#4963
Open
cachebag wants to merge 1 commit into
Open
Conversation
cachebag
force-pushed
the
test/crash-checkpoint-harness
branch
from
July 16, 2026 21:11
3531118 to
c6d83d7
Compare
This comment has been minimized.
This comment has been minimized.
rami3l
reviewed
Jul 16, 2026
djc
approved these changes
Jul 17, 2026
| } | ||
|
|
||
| #[cfg(feature = "test")] | ||
| crate::test::checkpoint::wait(download_cfg.process, "manifestation-update-before-metadata"); |
Contributor
There was a problem hiding this comment.
Nit: suggest importing checkpoint at the top of the module.
| @@ -0,0 +1,24 @@ | |||
| use std::{fs, path::PathBuf, thread}; | |||
Contributor
There was a problem hiding this comment.
IMO adding such small modules makes the source tree harder to navigate.
| let _ = child.wait(); | ||
| panic!("timed out waiting for checkpoint {checkpoint:?}"); | ||
| } | ||
| std::thread::sleep(StdDuration::from_millis(10)); |
cachebag
force-pushed
the
test/crash-checkpoint-harness
branch
from
July 17, 2026 13:32
c6d83d7 to
c069a84
Compare
This comment has been minimized.
This comment has been minimized.
cachebag
force-pushed
the
test/crash-checkpoint-harness
branch
from
July 17, 2026 13:34
c069a84 to
17511f4
Compare
cachebag
force-pushed
the
test/crash-checkpoint-harness
branch
from
July 17, 2026 13:34
17511f4 to
c7f9e73
Compare
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
rami3l
approved these changes
Jul 17, 2026
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.
Under the guidance of @rami3l, this is the first unit of work toward #4400, with #4724 as a related failure mode.
Ref: toolchain pool proposal
The plan is to establish deterministic infrastructure for testing hard interruptions without relying on debugger automation. This PR adds a test-only, environment-selected checkpoint mechanism. A child rustup process signals that it has reached the selected checkpoint and blocks; the test driver then kills and reaps it before retrying the operation in a fresh process.
This was my solution as opposed to something like a a debugger automation..but if it proves to be weak we can go that route instead. Would love feedback on this part.
The initial test interrupts installation after component payloads are installed but before toolchain metadata is written, then verifies that retrying converges to a working toolchain. This PR intentionally adds test infrastructure rather than changing recovery behavior.
(Additional named interruption points can be added as needed without changing the parent-process test harness, I figured a smaller scoped PR was appropriate first)
Follow-up work, generally speaking, will be as follows: