From a3a882ea078b303efb92e496cb5b508782a37a90 Mon Sep 17 00:00:00 2001 From: MOZGIII Date: Wed, 10 Jun 2020 23:26:39 +0300 Subject: [PATCH] Proper delay control at main test flow Signed-off-by: MOZGIII --- src/kubernetes/reflector.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/kubernetes/reflector.rs b/src/kubernetes/reflector.rs index 9ff25c26d57493..684856b9233cba 100644 --- a/src/kubernetes/reflector.rs +++ b/src/kubernetes/reflector.rs @@ -908,8 +908,9 @@ mod tests { let watcher = InstrumentingWatcher::new(watcher); // Prepare reflector. + let pause_between_requests = Duration::from_secs(60 * 60); // 1 hour let mut reflector = - Reflector::new(watcher, state_writer, None, None, Duration::from_secs(1)); + Reflector::new(watcher, state_writer, None, None, pause_between_requests); // Run test logic. let logic = tokio::spawn(async move { @@ -988,6 +989,10 @@ mod tests { .send(mock_watcher::ScenarioActionStream::Done) .await .unwrap(); + + // Advance the time to scroll pass the delay till next + // invocation. + tokio::time::advance(pause_between_requests * 2).await; } // We're done with the test! Shutdown the stream and force an