Skip to content

Commit

Permalink
test: Suppress repeated output when no flows
Browse files Browse the repository at this point in the history
Suppress repeated output that occurs when no flow have been received
yet, i.e., the first two lines of:

Validating 0 flows against 2 requirements
Validating 0 flows against 2 requirements
Validating 23 flows against 2 requirements

Signed-off-by: Jarno Rajahalme <[email protected]>
  • Loading branch information
jrajahalme authored and tklauser committed Sep 1, 2021
1 parent 970f248 commit 4fdacae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions connectivity/check/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,11 @@ r:
// Attempt to validate all flows received during the Action so far,
// once per validation interval.
case <-interval.C:
if len(a.flows) == 0 {
// Suppress output like 'Validating 0 flows against 2 requirements'
// as it is futile to validate requirements when there are no flows yet.
continue r
}
a.Debugf("Validating %d flows against %d requirements", len(a.flows), len(reqs))

res = a.matchAllFlowRequirements(ctx, reqs)
Expand Down

0 comments on commit 4fdacae

Please sign in to comment.