pub enum WorkerExitInfo {
Exited(i32),
Signaled(i32),
TimedOut,
WaitFailed(String),
Panicked(String),
}Expand description
Reason a sentinel WorkerReport was synthesized — attached to
the report’s exit_info field so operators can triage a missing
or undecodable postcard payload without cross-referencing
parent-side logs.
Invariant: every variant carries the waitpid-derived status for
the worker PID as of the end of stop_and_collect. Ordered from
most-informative (exit code) to least (plumbing failure).
No Default impl — every variant carries observed-outcome state.
A default-constructed value would have to pick one variant (TimedOut
was the obvious candidate) but that risks silent-pass: a test
fixture using ..Default::default() on a struct containing
WorkerExitInfo gets “worker never exited within the deadline,”
which an operator triaging the failure would chase for minutes
before realizing the value came from a missing field. Construct
every WorkerExitInfo explicitly via the variant the test scenario
expects (e.g. WorkerExitInfo::Exited(0) for a clean success).
Variants§
Exited(i32)
WIFEXITED=true with the given exit code. Non-zero under
panic = "unwind" means catch_unwind caught a panic in the
worker-child closure and _exit(1) fired, or the 30s
parent-ready poll timed out. Zero means the worker ran to
completion but failed to write / serialize the report — a
postcard encode or pipe-write failure that didn’t panic.
Signaled(i32)
WIFSIGNALED=true with the given signal number. Under
panic = "abort" a worker panic raises SIGABRT (signal 6);
other values indicate external kill, OOM killer, or the
still-alive-escalation SIGKILL (signal 9) from this function.
TimedOut
Worker was still running after the 5s shared collection
deadline; escalated via SIGKILL + blocking waitpid. The
child’s final status is not retained — the reap happened past
the point where operator diagnostics would differ between a
clean timeout and a signal storm.
WaitFailed(String)
waitpid itself returned Err — typically ECHILD (child
already reaped by an external signal handler or a double-reap
regression) or EINTR. Message is the rendered errno string.
Panicked(String)
Thread-mode worker panicked. JoinHandle::join() returned
Err; the inner payload is downcast to a &str / String
(the canonical panic! payload shapes) and recorded here so
the operator can triage without scraping the test log. This
variant is exclusive to CloneMode::Thread — fork workers
surface panics via Exited(1) or Signaled(SIGABRT)
depending on the panic strategy.
Trait Implementations§
Source§impl Clone for WorkerExitInfo
impl Clone for WorkerExitInfo
Source§fn clone(&self) -> WorkerExitInfo
fn clone(&self) -> WorkerExitInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkerExitInfo
impl Debug for WorkerExitInfo
Source§impl<'de> Deserialize<'de> for WorkerExitInfo
impl<'de> Deserialize<'de> for WorkerExitInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for WorkerExitInfo
impl RefUnwindSafe for WorkerExitInfo
impl Send for WorkerExitInfo
impl Sync for WorkerExitInfo
impl Unpin for WorkerExitInfo
impl UnwindSafe for WorkerExitInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more