Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Avoid spamming logs in monitor aggregation test #25152

Merged
merged 1 commit into from Apr 27, 2023

Conversation

pchaigno
Copy link
Member

The monitor aggregation tests are currently spamming the logs because they dump useless matches from regular expressions. Let's remove that.

@pchaigno pchaigno added area/CI-improvement Topic or proposal to improve the Continuous Integration workflow release-note/ci This PR makes changes to the CI. labels Apr 26, 2023
@pchaigno pchaigno force-pushed the improve-monitor-aggregation-tests branch from d13cfe7 to b0284c2 Compare April 26, 2023 21:58
@pchaigno
Copy link
Member Author

/test

@pchaigno pchaigno marked this pull request as ready for review April 27, 2023 07:29
@pchaigno pchaigno requested review from a team as code owners April 27, 2023 07:29
Copy link
Contributor

@viktor-kurchenko viktor-kurchenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

test/k8s/datapath_configuration.go Show resolved Hide resolved
test/k8s/datapath_configuration.go Show resolved Hide resolved
The monitor aggregation tests are currently spamming the logs because
they dump useless matches from regular expressions. Let's remove that.

Most of the log spam comes from the use of %+v to dump the regexp
matches. That doesn't even work properly and ends up dumping a huge
matrix of integers. Given we retry this step until it eventually
succeeds, this can add up to several megabytes of logs.

In addition to removing this dump of the regexp matches, we also switch
the checkMonitorOutput function to return an error instead of a boolean.
The consequence of that change is that the Eventually block will display
the actual error message from checkMonitorOutput on failure. The test
logs won't contain one error message (GinkgoPrint) per failure, but only
the last error message we got before timing out. I believe that's what
we want because: 1) it surfaces the actual error in the ginkgo results
instead of telling us "expected true, got false" (duh!) and (2) in logs,
we only care about the last error message.

Signed-off-by: Paul Chaignon <paul@cilium.io>
@pchaigno pchaigno force-pushed the improve-monitor-aggregation-tests branch from b0284c2 to e056a37 Compare April 27, 2023 16:54
@pchaigno
Copy link
Member Author

The last force push only updated the commit description to account for the review discussion. All Jenkins test were passing before that so merging without rerunning. Thanks for the reviews Viktor and Maxim!

@pchaigno pchaigno merged commit 2a57194 into cilium:main Apr 27, 2023
33 of 34 checks passed
@pchaigno pchaigno deleted the improve-monitor-aggregation-tests branch April 27, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CI-improvement Topic or proposal to improve the Continuous Integration workflow release-note/ci This PR makes changes to the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants