Skip to main content

FailedCommits

Struct FailedCommits 

Source
pub struct FailedCommits { /* private fields */ }
Expand description

Commits that failed in an earlier run, with how and under what.

Without a memory of these, a commit that can never be recorded is chosen again at the top of every run, and with --limit a backfill stops making progress at the first one. That holds for a failed measurement as much as for a failed build: at a fixed commit, a benchmark that errors or a fixture that is missing fails the same way every time. A flaky one costs a point --force can recover, where not remembering it cost every older commit behind it.

A build failure is per commit, and keyed on the runner class and [build], so changing the build — usually to fix exactly that failure — or moving to a new toolchain tries the commit again. A measurement failure is per benchmark, so a run of other benchmarks (--bench B after --bench A failed) still measures them, and it is keyed on those and on the contents of tak.toml as well, since editing a benchmark is how one of those gets fixed. Not on --runs: a benchmark that errors at five runs errors at ten, and one that only fails sometimes is what --force is for. Kept in git’s common directory: shared by the repository’s worktrees, never committed, and local to this clone, since a failure says as much about this machine as about the commit.

One line per failure: SHA \t build-failed \t KEY, or SHA \t measure-failed \t BENCH \t KEY with the benchmark’s name as a JSON string, which cannot hold a tab. A line written before reasons were recorded, SHA \t KEY, is a build failure.

Implementations§

Source§

impl FailedCommits

Source

pub fn load(build_key: String, measure_key: String) -> Result<FailedCommits>

The commits that failed under these keys: build_key describes the runner class and [build], measure_key those and the benchmarks.

Source

pub fn build_failed(&self, sha: &str) -> bool

Whether sha’s build failed before under these keys.

Source

pub fn measure_failed(&self, sha: &str, bench: &str) -> bool

Whether measuring bench at sha failed before under these keys.

Source

pub fn add(&mut self, sha: &str, failure: Failure) -> Result<()>

Remember a failure at sha.

Source

pub fn recorded(&mut self, sha: &str, benches: &[String]) -> Result<()>

sha built, and benches were recorded there (none, when measuring failed): forget its build failure and theirs. Failures of other benchmarks stay.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.