Skip to content

Commit

Permalink
Speed up file watcher test happy paths (#199)
Browse files Browse the repository at this point in the history
With a slightly lower delay and a higher number of retries we still test
for roughly the same amount of time worst case (less than 5 seconds)
while being back to a faster happy path
  • Loading branch information
CosmicHorrorDev authored Dec 16, 2023
1 parent d51f838 commit ad7e04b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/file_watcher/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ struct Delays {
impl Delays {
fn new() -> Self {
Self {
delay: Duration::from_millis(100),
short_timeout: Duration::from_millis(50),
long_timeout: Duration::from_millis(2_000),
delay: Duration::from_millis(75),
short_timeout: Duration::from_millis(25),
long_timeout: Duration::from_millis(1_500),
}
}

Expand Down Expand Up @@ -105,7 +105,7 @@ macro_rules! gen_watcher_test {
// Give the test a few chances
let mut last_panic = None;
let mut delays = Delays::new();
for _ in 0..3 {
for _ in 0..4 {
let result = std::panic::catch_unwind(|| {
let test_dir = TestEnv::init();
// Give the watcher time to get comfy :)
Expand Down

0 comments on commit ad7e04b

Please sign in to comment.