From 4fdacae8b91c4fed8550f75e3ee314d0fd0e4a19 Mon Sep 17 00:00:00 2001 From: Jarno Rajahalme Date: Tue, 20 Jul 2021 12:08:49 +0300 Subject: [PATCH] test: Suppress repeated output when no flows 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 --- connectivity/check/action.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/connectivity/check/action.go b/connectivity/check/action.go index 436a606d97..6c07bd83e7 100644 --- a/connectivity/check/action.go +++ b/connectivity/check/action.go @@ -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)