Skip to content

Commit

Permalink
fix: actually limit the time taken to shrink (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekleog authored Jan 13, 2024
1 parent 62577a6 commit c5edc8e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/bolero-engine/src/shrink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ impl<'a, T: Test> Shrinker<'a, T> {
}

self.apply_transforms(index, &mut was_changed);

// put a time limit on the number of shrink attempts
if start_time.elapsed() > shrink_time {
break;
}
}

// we made it through all of the transforms without shrinking
Expand Down

0 comments on commit c5edc8e

Please sign in to comment.