Skip to content

Commit c868ebf

Browse files
committed
Ignore inactive connections
When waiting for an expected amount of connections in tests, there are occurences of repetition due to an "in-flight" connections that are apparently got caught without close timestamp. Ignore those.
1 parent f3b8b35 commit c868ebf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

integration-tests/pkg/mock_sensor/expect_conn.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ loop:
7272
if conn.GetContainerId() != containerID {
7373
continue loop
7474
}
75+
// If we observe an "in-flight" connection without a closed
76+
// timestamp, ignore it as we will get it later with full
77+
// information.
78+
if !conn.IsActive() {
79+
continue loop
80+
}
7581
if len(s.Connections(containerID)) == n {
7682
return s.Connections(containerID)
7783
}

0 commit comments

Comments
 (0)