From 8de50619f170203e21f1ed3d5bd9ba6e80fefaee Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Tue, 19 May 2015 11:30:42 +0200 Subject: [PATCH] Increase target test wait times On slow systems such as Travis CI occasionally the tests fail because the wait times are too short. --- retrieval/target_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/retrieval/target_test.go b/retrieval/target_test.go index 6a411f86a..9a5ad481d 100644 --- a/retrieval/target_test.go +++ b/retrieval/target_test.go @@ -135,7 +135,7 @@ func TestTargetScrapeTimeout(t *testing.T) { ) defer server.Close() - testTarget := newTestTarget(server.URL, 10*time.Millisecond, clientmodel.LabelSet{}) + testTarget := newTestTarget(server.URL, 25*time.Millisecond, clientmodel.LabelSet{}) appender := nopAppender{} @@ -146,7 +146,7 @@ func TestTargetScrapeTimeout(t *testing.T) { } // let the deadline lapse - time.Sleep(15 * time.Millisecond) + time.Sleep(30 * time.Millisecond) // now scrape again signal <- true @@ -194,17 +194,17 @@ func TestTargetRunScraperScrapes(t *testing.T) { go testTarget.RunScraper(nopAppender{}) // Enough time for a scrape to happen. - time.Sleep(2 * time.Millisecond) + time.Sleep(10 * time.Millisecond) if testTarget.status.LastScrape().IsZero() { t.Errorf("Scrape hasn't occured.") } testTarget.StopScraper() // Wait for it to take effect. - time.Sleep(2 * time.Millisecond) + time.Sleep(5 * time.Millisecond) last := testTarget.status.LastScrape() // Enough time for a scrape to happen. - time.Sleep(2 * time.Millisecond) + time.Sleep(10 * time.Millisecond) if testTarget.status.LastScrape() != last { t.Errorf("Scrape occured after it was stopped.") }