test(mcp): say what the running-call test proves; name the phase watcher's type
The running-call test passes even with a cut that marks every request inside (mutation check): the call runs in the session's task, past the handler's own check for a cut, so what it proves is that the close waits for the call and does not kill it. The line of the cut (a body read to its end is never cut) is proved at its seat by local::tests::a_body_read_to_its_end_is_never_cut_and_one_not_yet_is, which fails when a later poll can cut a whole body. Also a type alias for clippy's type_complexity. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f6daba558b
commit
7e5b698c1c
2 files changed
+11
-3
No files matched your search
@@ -1459,7 +1459,12 @@ fn a_slow_upload_that_finishes_within_the_grace_is_not_cut() {
|
||||
|
||||
/// A call whose body is whole and that is running when the grace runs out
|
||||
/// is not cut: it ends, is answered and recorded as having run, and only
|
||||
/// then is the close answered.
|
||||
/// then is the close answered. What this proves is that the close waits for
|
||||
/// the call and does not kill it; that a body read to its end is never cut
|
||||
/// (the line of INVARIANT 15) is proved at its seat, by
|
||||
/// `local::tests::a_body_read_to_its_end_is_never_cut_and_one_not_yet_is`:
|
||||
/// this test passes even with a cut that marks every request inside (the
|
||||
/// call runs in the session's task, past the handler's own check for a cut).
|
||||
#[cfg(unix)]
|
||||
#[test]
|
||||
fn a_running_call_is_never_cut_when_the_grace_runs_out() {
|
||||
|
||||
@@ -189,12 +189,15 @@ pub struct LockNote {
|
||||
pub why: &'static str,
|
||||
}
|
||||
|
||||
/// A watcher of a verification's phases ([`Git::with_phase_watch`]).
|
||||
pub type PhaseWatch = std::sync::Arc<dyn Fn(&str) + Send + Sync>;
|
||||
|
||||
/// What a caller may watch of a git's work, and look at after it (tests,
|
||||
/// and the server's record of a backup).
|
||||
#[derive(Clone, Default)]
|
||||
struct Watch {
|
||||
/// Told the name of each phase of a verification as it begins.
|
||||
phase: Option<std::sync::Arc<dyn Fn(&str) + Send + Sync>>,
|
||||
phase: Option<PhaseWatch>,
|
||||
/// The lock files dealt with since the caller last took them.
|
||||
notes: std::sync::Arc<std::sync::Mutex<Vec<LockNote>>>,
|
||||
}
|
||||
@@ -285,7 +288,7 @@ impl Git {
|
||||
/// that makes a drill slow: `watch` may wait, but must give up when
|
||||
/// the cancel flag is set).
|
||||
#[must_use]
|
||||
pub fn with_phase_watch(mut self, watch: std::sync::Arc<dyn Fn(&str) + Send + Sync>) -> Self {
|
||||
pub fn with_phase_watch(mut self, watch: PhaseWatch) -> Self {
|
||||
self.watch.phase = Some(watch);
|
||||
self
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user