mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-12 06:24:10 +01:00
flow: also increase timings
A bit concerned about the Gitlab runner...
This commit is contained in:
@@ -41,7 +41,7 @@ out1:
|
|||||||
select {
|
select {
|
||||||
case flow := <-c.Flows():
|
case flow := <-c.Flows():
|
||||||
t.Fatalf("After sending option template, received a flow while we should not:\n%v", flow)
|
t.Fatalf("After sending option template, received a flow while we should not:\n%v", flow)
|
||||||
case <-time.After(10 * time.Millisecond):
|
case <-time.After(30 * time.Millisecond):
|
||||||
break out1
|
break out1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ out2:
|
|||||||
select {
|
select {
|
||||||
case flow := <-c.Flows():
|
case flow := <-c.Flows():
|
||||||
t.Fatalf("After sending option flowset, received a flow while we should not:\n%v", flow)
|
t.Fatalf("After sending option flowset, received a flow while we should not:\n%v", flow)
|
||||||
case <-time.After(10 * time.Millisecond):
|
case <-time.After(30 * time.Millisecond):
|
||||||
break out2
|
break out2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ out3:
|
|||||||
select {
|
select {
|
||||||
case flow := <-c.Flows():
|
case flow := <-c.Flows():
|
||||||
t.Fatalf("After sending template, received a flow while we should not:\n%v", flow)
|
t.Fatalf("After sending template, received a flow while we should not:\n%v", flow)
|
||||||
case <-time.After(10 * time.Millisecond):
|
case <-time.After(30 * time.Millisecond):
|
||||||
break out3
|
break out3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -225,7 +225,7 @@ out4:
|
|||||||
case flow := <-c.Flows():
|
case flow := <-c.Flows():
|
||||||
flow.TimeReceived = 0
|
flow.TimeReceived = 0
|
||||||
received = append(received, flow)
|
received = append(received, flow)
|
||||||
case <-time.After(10 * time.Millisecond):
|
case <-time.After(30 * time.Millisecond):
|
||||||
break out4
|
break out4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -302,33 +302,33 @@ func TestOutgoingChanFull(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We should receive 4 flows. The queue size is 1. So, the second flow is blocked.
|
// We should receive 4 flows. The queue size is 1. So, the second flow is blocked.
|
||||||
time.Sleep(10 * time.Millisecond)
|
time.Sleep(30 * time.Millisecond)
|
||||||
checkQueueFullMetric("1")
|
checkQueueFullMetric("1")
|
||||||
|
|
||||||
// Accept the first flow and the third flow gets blocked too.
|
// Accept the first flow and the third flow gets blocked too.
|
||||||
select {
|
select {
|
||||||
case <-c.Flows():
|
case <-c.Flows():
|
||||||
case <-time.After(10 * time.Millisecond):
|
case <-time.After(30 * time.Millisecond):
|
||||||
t.Fatal("First flow missing")
|
t.Fatal("First flow missing")
|
||||||
}
|
}
|
||||||
time.Sleep(10 * time.Millisecond)
|
time.Sleep(30 * time.Millisecond)
|
||||||
checkQueueFullMetric("2")
|
checkQueueFullMetric("2")
|
||||||
|
|
||||||
// Accept the second flow and the fourth one gets blocked
|
// Accept the second flow and the fourth one gets blocked
|
||||||
select {
|
select {
|
||||||
case <-c.Flows():
|
case <-c.Flows():
|
||||||
case <-time.After(10 * time.Millisecond):
|
case <-time.After(30 * time.Millisecond):
|
||||||
t.Fatal("Second flow missing")
|
t.Fatal("Second flow missing")
|
||||||
}
|
}
|
||||||
time.Sleep(10 * time.Millisecond)
|
time.Sleep(30 * time.Millisecond)
|
||||||
checkQueueFullMetric("3")
|
checkQueueFullMetric("3")
|
||||||
|
|
||||||
// Accept the third flow and no more blocked flow
|
// Accept the third flow and no more blocked flow
|
||||||
select {
|
select {
|
||||||
case <-c.Flows():
|
case <-c.Flows():
|
||||||
case <-time.After(10 * time.Millisecond):
|
case <-time.After(30 * time.Millisecond):
|
||||||
t.Fatal("Third flow missing")
|
t.Fatal("Third flow missing")
|
||||||
}
|
}
|
||||||
time.Sleep(10 * time.Millisecond)
|
time.Sleep(30 * time.Millisecond)
|
||||||
checkQueueFullMetric("3")
|
checkQueueFullMetric("3")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user