Package: golang-github-mwitkow-go-conntrack / 0.0~git20190716.2f06839-1

01-Fix_flaky_test.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Description: Add a small delay to allow metrics to be collected; otherwise this
    test fails under high CPU contention.
Update: Increased the delay from 5 to 100 ms.
        To further reduce the posibility of failing.
--- a/listener_test.go
+++ b/listener_test.go
@@ -78,6 +78,7 @@
 	assert.Equal(s.T(), beforeClosed, sumCountersForMetricAndLabels(s.T(), "net_conntrack_listener_conn_closed_total", listenerName),
 		"the closed conn counter must not be incremented before the connection is closed")
 	conn.Close()
+	time.Sleep(100 * time.Millisecond)
 	assert.Equal(s.T(), beforeClosed+1, sumCountersForMetricAndLabels(s.T(), "net_conntrack_listener_conn_closed_total", listenerName),
 		"the closed conn counter must be incremented after connection was closed")
 }