Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use proptest to fuzz the resolver #5921

Merged
merged 33 commits into from
Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
56a222c
a start on using proptest to fuzz the resolver
Eh2406 Aug 21, 2018
1761886
cache the example url to solve performance problem
Eh2406 Aug 21, 2018
ce1772c
get working with minimal-versions
Eh2406 Aug 21, 2018
4e619d8
better generation of version numbers
Eh2406 Aug 22, 2018
732aa10
small clean up
Eh2406 Aug 22, 2018
c26553a
small clean up
Eh2406 Aug 22, 2018
b7285e8
handle "bad" slightly better
Eh2406 Aug 23, 2018
5339e92
small clean up for the cache of the example url
Eh2406 Aug 23, 2018
f270dda
incorporate @AltSysrq suggestions
Eh2406 Aug 24, 2018
17fe190
update to the new version of proptest
Eh2406 Aug 27, 2018
85b1976
use the new `impl Strategy for Vec<S>` to only generate valid depende…
Eh2406 Aug 27, 2018
0ef43cb
use the new `result_cache`
Eh2406 Aug 27, 2018
0206cec
double down on `prop_flat_map` to guarantee version requirements are …
Eh2406 Aug 27, 2018
1f98871
stronger assert in the core
Eh2406 Aug 25, 2018
b0bbb6a
use args for scale
Eh2406 Aug 28, 2018
2628ec0
works a LOT better if the simple cases are at the beginning
Eh2406 Aug 29, 2018
509806e
small clean up
Eh2406 Aug 30, 2018
d6258e9
Merge remote-tracking branch 'origin/master' into proptest
Eh2406 Aug 30, 2018
1eaf543
small clean up
Eh2406 Aug 30, 2018
2b1c39f
more controllable bad dependencies, and use Index for ranges
Eh2406 Aug 30, 2018
05c6ce0
remove a `prop_flat_map` use @AltSysrq suggestion again
Eh2406 Aug 31, 2018
856964f
fail fast on CI, don't shrink the input
Eh2406 Aug 31, 2018
2b16156
If resolution was successful, then unpublishing a version of a crate …
Eh2406 Sep 5, 2018
c497851
If resolution was unsuccessful, then it should stay unsuccessful even…
Eh2406 Sep 5, 2018
1b15b15
give intermediate steps names
Eh2406 Sep 17, 2018
d8e19fb
pull the has bad dep before `prop_flat_map`
Eh2406 Sep 17, 2018
2015191
`edge list` is a much cleaner approach
Eh2406 Sep 17, 2018
7ad9f5e
add a test to test the tester
Eh2406 Sep 19, 2018
6bd2540
check each registry more thoroughly
Eh2406 Sep 18, 2018
40d9de4
Merge remote-tracking branch 'origin/master' into proptest
Eh2406 Sep 20, 2018
3e7192e
pretty print the registry made by proptest
Eh2406 Sep 21, 2018
6763ede
proptest 0.8.7 has a better `ci_no_shrink`
Eh2406 Sep 24, 2018
a4da525
In theory shrinkage should be 2, but in practice we get better trees …
Eh2406 Sep 24, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ features = [

[dev-dependencies]
bufstream = "0.1"
proptest = "0.8.7"

[[bin]]
name = "cargo"
Expand Down
14 changes: 13 additions & 1 deletion src/cargo/core/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ fn activate_deps_loop(
}
}

let mut ticks = 0;
let mut ticks = 0u16;
let start = Instant::now();
let time_to_print = Duration::from_millis(500);
let mut printed = false;
Expand Down Expand Up @@ -240,6 +240,18 @@ fn activate_deps_loop(
config.shell().status("Resolving", "dependency graph...")?;
}
}
// The largest test in our sweet takes less then 5000 ticks
Copy link
Member

@killercup killercup Sep 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/sweet/sweet test suite

:trollface:

(same below)

// with all the algorithm improvements.
// If any of them are removed then it takes more than I am willing to measure.
// So lets fail the test fast if we have ben running for two long.
debug_assert!(ticks < 50_000);
// The largest test in our sweet takes less then 30 sec
// with all the improvements to how fast a tick can go.
// If any of them are removed then it takes more than I am willing to measure.
// So lets fail the test fast if we have ben running for two long.
if cfg!(debug_assertions) && (ticks % 1000 == 0) {
assert!(start.elapsed() - deps_time < Duration::from_secs(90));
}

let just_here_for_the_error_messages = deps_frame.just_for_error_messages;

Expand Down
4 changes: 4 additions & 0 deletions tests/testsuite/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ extern crate flate2;
extern crate git2;
extern crate glob;
extern crate hex;
#[macro_use]
extern crate lazy_static;
extern crate libc;
#[macro_use]
extern crate proptest;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate serde_json;
Expand Down
Loading