-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fast fail feature - Stops verification process as soon as one failure…
… is observed - Use case : CI speed up (#3879) Resolves #3458 Added the option `--fail-fast`, which would stop the verification process whenever any of the harnesses fails, and returns the failed harness as an error. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. --------- Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
- Loading branch information
1 parent
759e2c5
commit 4f78926
Showing
6 changed files
with
129 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
1 change: 1 addition & 0 deletions
1
tests/ui/multiple-harnesses/stop_at_single_fail/fail_fast_test.expected
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Complete - 0 successfully verified harnesses, 1 failures, 1 total. |
26 changes: 26 additions & 0 deletions
26
tests/ui/multiple-harnesses/stop_at_single_fail/fail_fast_test.rs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// kani-flags: --fail-fast | ||
//! Ensure that the verification process stops as soon as one of the harnesses fails. | ||
mod tests { | ||
#[kani::proof] | ||
fn test_01_fail() { | ||
assert!(false, "First failure"); | ||
} | ||
|
||
#[kani::proof] | ||
fn test_02_fail() { | ||
assert!(false, "Second failure"); | ||
} | ||
|
||
#[kani::proof] | ||
fn test_03_fail() { | ||
assert!(false, "Third failure"); | ||
} | ||
|
||
#[kani::proof] | ||
fn test_04_fail() { | ||
assert!(false, "Fourth failure"); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
tests/ui/multiple-harnesses/stop_at_single_fail/fail_fast_test_parallel.expected
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Complete - 0 successfully verified harnesses, 1 failures, 1 total. |
57 changes: 57 additions & 0 deletions
57
tests/ui/multiple-harnesses/stop_at_single_fail/fail_fast_test_parallel.rs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// kani-flags: --fail-fast -Z unstable-options --jobs 4 --output-format=terse | ||
//! Ensure that the verification process stops as soon as one of the harnesses fails. | ||
//! This test runs on 4 parallel threads. Stops verification as soon as a harness on any of the threads fails. | ||
mod tests { | ||
#[kani::proof] | ||
fn test_01_fail() { | ||
assert!(false, "First failure"); | ||
} | ||
|
||
#[kani::proof] | ||
fn test_02_fail() { | ||
assert!(false, "Second failure"); | ||
} | ||
|
||
#[kani::proof] | ||
fn test_03_fail() { | ||
assert!(false, "Third failure"); | ||
} | ||
|
||
#[kani::proof] | ||
fn test_04_fail() { | ||
assert!(false, "Fourth failure"); | ||
} | ||
|
||
#[kani::proof] | ||
fn test_05_fail() { | ||
assert!(false, "Fifth failure"); | ||
} | ||
|
||
#[kani::proof] | ||
fn test_06_fail() { | ||
assert!(false, "Sixth failure"); | ||
} | ||
|
||
#[kani::proof] | ||
fn test_07_fail() { | ||
assert!(false, "Seventh failure"); | ||
} | ||
|
||
#[kani::proof] | ||
fn test_08_fail() { | ||
assert!(false, "Eighth failure"); | ||
} | ||
|
||
#[kani::proof] | ||
fn test_09_fail() { | ||
assert!(false, "Ninth failure"); | ||
} | ||
|
||
#[kani::proof] | ||
fn test_10_fail() { | ||
assert!(false, "Tenth failure"); | ||
} | ||
} |