Increase target test wait times

On slow systems such as Travis CI occasionally the tests fail
because the wait times are too short.
This commit is contained in:
Fabian Reinartz 2015-05-19 11:30:42 +02:00
parent 2843ff6a0d
commit 8de50619f1
1 changed files with 5 additions and 5 deletions

View File

@ -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.")
}