mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
Add travis multiplier
This commit is contained in:
@@ -155,7 +155,7 @@ func TestStreamFramer_Flush(t *testing.T) {
|
||||
|
||||
select {
|
||||
case <-resultCh:
|
||||
case <-time.After(2 * bWindow):
|
||||
case <-time.After(2 * time.Duration(testutil.TestMultiplier()) * bWindow):
|
||||
t.Fatalf("failed to flush")
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ func TestStreamFramer_Flush(t *testing.T) {
|
||||
|
||||
select {
|
||||
case <-sf.ExitCh():
|
||||
case <-time.After(2 * hRate):
|
||||
case <-time.After(2 * time.Duration(testutil.TestMultiplier()) * hRate):
|
||||
t.Fatalf("exit channel should close")
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ func TestStreamFramer_Batch(t *testing.T) {
|
||||
select {
|
||||
case <-resultCh:
|
||||
t.Fatalf("Got data before frame size reached")
|
||||
case <-time.After(bWindow / 2):
|
||||
case <-time.After(bWindow * time.Duration(testutil.TestMultiplier()) / 2):
|
||||
}
|
||||
|
||||
// Write the rest so we hit the frame size
|
||||
@@ -235,7 +235,7 @@ func TestStreamFramer_Batch(t *testing.T) {
|
||||
// Ensure we get data
|
||||
select {
|
||||
case <-resultCh:
|
||||
case <-time.After(2 * bWindow):
|
||||
case <-time.After(2 * time.Duration(testutil.TestMultiplier()) * bWindow):
|
||||
t.Fatalf("Did not receive data after batch size reached")
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ func TestStreamFramer_Batch(t *testing.T) {
|
||||
|
||||
select {
|
||||
case <-sf.ExitCh():
|
||||
case <-time.After(2 * hRate):
|
||||
case <-time.After(2 * time.Duration(testutil.TestMultiplier()) * hRate):
|
||||
t.Fatalf("exit channel should close")
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ func TestStreamFramer_Heartbeat(t *testing.T) {
|
||||
|
||||
select {
|
||||
case <-resultCh:
|
||||
case <-time.After(2 * hRate):
|
||||
case <-time.After(2 * time.Duration(testutil.TestMultiplier()) * hRate):
|
||||
t.Fatalf("failed to heartbeat")
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ func TestStreamFramer_Heartbeat(t *testing.T) {
|
||||
|
||||
select {
|
||||
case <-sf.ExitCh():
|
||||
case <-time.After(2 * hRate):
|
||||
case <-time.After(2 * time.Duration(testutil.TestMultiplier()) * hRate):
|
||||
t.Fatalf("exit channel should close")
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ func TestStreamFramer_Order(t *testing.T) {
|
||||
// Ensure we get data
|
||||
select {
|
||||
case <-resultCh:
|
||||
case <-time.After(10 * bWindow):
|
||||
case <-time.After(10 * time.Duration(testutil.TestMultiplier()) * bWindow):
|
||||
got := receivedBuf.String()
|
||||
want := expected.String()
|
||||
t.Fatalf("Got %v; want %v", got, want)
|
||||
@@ -387,7 +387,7 @@ func TestStreamFramer_Order(t *testing.T) {
|
||||
|
||||
select {
|
||||
case <-sf.ExitCh():
|
||||
case <-time.After(2 * hRate):
|
||||
case <-time.After(2 * time.Duration(testutil.TestMultiplier()) * hRate):
|
||||
t.Fatalf("exit channel should close")
|
||||
}
|
||||
|
||||
@@ -535,14 +535,14 @@ func TestHTTP_Stream_Modify(t *testing.T) {
|
||||
|
||||
// Sleep a little before writing more. This lets us check if the watch
|
||||
// is working.
|
||||
time.Sleep(1 * time.Second)
|
||||
time.Sleep(1 * time.Duration(testutil.TestMultiplier()) * time.Second)
|
||||
if _, err := f.Write(data[3:]); err != nil {
|
||||
t.Fatalf("write failed: %v", err)
|
||||
}
|
||||
|
||||
select {
|
||||
case <-resultCh:
|
||||
case <-time.After(2 * streamBatchWindow):
|
||||
case <-time.After(2 * time.Duration(testutil.TestMultiplier()) * streamBatchWindow):
|
||||
t.Fatalf("failed to send new data")
|
||||
}
|
||||
})
|
||||
@@ -616,7 +616,7 @@ func TestHTTP_Stream_Truncate(t *testing.T) {
|
||||
|
||||
// Sleep a little before truncating. This lets us check if the watch
|
||||
// is working.
|
||||
time.Sleep(1 * time.Second)
|
||||
time.Sleep(1 * time.Duration(testutil.TestMultiplier()) * time.Second)
|
||||
if err := f.Truncate(0); err != nil {
|
||||
t.Fatalf("truncate failed: %v", err)
|
||||
}
|
||||
@@ -638,20 +638,20 @@ func TestHTTP_Stream_Truncate(t *testing.T) {
|
||||
|
||||
select {
|
||||
case <-truncateCh:
|
||||
case <-time.After(2 * streamBatchWindow):
|
||||
case <-time.After(2 * time.Duration(testutil.TestMultiplier()) * streamBatchWindow):
|
||||
t.Fatalf("did not receive truncate")
|
||||
}
|
||||
|
||||
// Sleep a little before writing more. This lets us check if the watch
|
||||
// is working.
|
||||
time.Sleep(1 * time.Second)
|
||||
time.Sleep(1 * time.Duration(testutil.TestMultiplier()) * time.Second)
|
||||
if _, err := f2.Write(data[5:]); err != nil {
|
||||
t.Fatalf("write failed: %v", err)
|
||||
}
|
||||
|
||||
select {
|
||||
case <-dataPostTruncCh:
|
||||
case <-time.After(2 * streamBatchWindow):
|
||||
case <-time.After(2 * time.Duration(testutil.TestMultiplier()) * streamBatchWindow):
|
||||
t.Fatalf("did not receive post truncate data")
|
||||
}
|
||||
})
|
||||
@@ -718,14 +718,14 @@ func TestHTTP_Stream_Delete(t *testing.T) {
|
||||
|
||||
// Sleep a little before deleting. This lets us check if the watch
|
||||
// is working.
|
||||
time.Sleep(1 * time.Second)
|
||||
time.Sleep(1 * time.Duration(testutil.TestMultiplier()) * time.Second)
|
||||
if err := os.Remove(streamFilePath); err != nil {
|
||||
t.Fatalf("delete failed: %v", err)
|
||||
}
|
||||
|
||||
select {
|
||||
case <-deleteCh:
|
||||
case <-time.After(4 * streamBatchWindow):
|
||||
case <-time.After(4 * time.Duration(testutil.TestMultiplier()) * streamBatchWindow):
|
||||
t.Fatalf("did not receive delete")
|
||||
}
|
||||
|
||||
@@ -807,7 +807,7 @@ func TestHTTP_Logs_NoFollow(t *testing.T) {
|
||||
|
||||
select {
|
||||
case <-resultCh:
|
||||
case <-time.After(4 * streamBatchWindow):
|
||||
case <-time.After(4 * time.Duration(testutil.TestMultiplier()) * streamBatchWindow):
|
||||
t.Fatalf("did not receive data: got %q", string(received))
|
||||
}
|
||||
|
||||
@@ -896,7 +896,7 @@ func TestHTTP_Logs_Follow(t *testing.T) {
|
||||
|
||||
select {
|
||||
case <-firstResultCh:
|
||||
case <-time.After(4 * streamBatchWindow):
|
||||
case <-time.After(4 * time.Duration(testutil.TestMultiplier()) * streamBatchWindow):
|
||||
t.Fatalf("did not receive data: got %q", string(received))
|
||||
}
|
||||
|
||||
@@ -908,7 +908,7 @@ func TestHTTP_Logs_Follow(t *testing.T) {
|
||||
|
||||
select {
|
||||
case <-fullResultCh:
|
||||
case <-time.After(4 * streamBatchWindow):
|
||||
case <-time.After(4 * time.Duration(testutil.TestMultiplier()) * streamBatchWindow):
|
||||
t.Fatalf("did not receive data: got %q", string(received))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user