pub struct Tolerance {
pub tasks: usize,
pub descriptors: usize,
pub outstanding: usize,
pub resident_kb: usize,
}Expand description
How much drift is noise rather than a leak.
Not zero, and the reason is worth stating: a runtime keeps blocking-pool threads alive after
use, an allocator does not return every page, and a descriptor may still be in TIME_WAIT.
A tolerance of zero produces a test that fails at random, and a test that fails at random is
a test that gets deleted.
Fields§
§tasks: usizeExtra tasks allowed at the end.
descriptors: usizeExtra descriptors allowed.
outstanding: usizeExtra outstanding items allowed.
resident_kb: usizeExtra resident kilobytes allowed.
Much the largest tolerance here, and it has to be. An allocator does not return every freed page to the kernel, a runtime grows its per-thread caches on first use, and the first few hundred calls touch code paths that are still being faulted in. Sixteen megabytes is loose enough not to fail on any of that and tight enough that a leak of a kilobyte per call shows up within a few thousand calls.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tolerance
impl RefUnwindSafe for Tolerance
impl Send for Tolerance
impl Sync for Tolerance
impl Unpin for Tolerance
impl UnsafeUnpin for Tolerance
impl UnwindSafe for Tolerance
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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