-
Notifications
You must be signed in to change notification settings - Fork 361
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
killer sensor: improve testing #1948
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
1 task
kkourt
added
the
release-note/minor
This PR introduces a minor user-visible change
label
Jan 9, 2024
kkourt
force-pushed
the
pr/kkourt/killer-improvements
branch
2 times, most recently
from
January 9, 2024 09:09
17c3547
to
153eb1a
Compare
kkourt
added
release-note/ci
This PR makes changes to the CI.
and removed
release-note/minor
This PR introduces a minor user-visible change
labels
Jan 9, 2024
kkourt
changed the title
improvements to the killer sensor: better testing and supporting fmod_ret
killer sensor: improve testing
Jan 9, 2024
kkourt
force-pushed
the
pr/kkourt/killer-improvements
branch
2 times, most recently
from
January 9, 2024 10:40
c34a1a4
to
99b8ebd
Compare
Currently, if all tests are skipped we print success, which is misleading. Print a better message. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
Previously, we always used "." to list tests in listTests. This patch adds it as an argument to be used in a later patch. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
This patch improves loading tests form a file. First, it allows for having comments with lines starting with '#'. Second, it lists the tests based on the provided user pattern instead of using it as it is. Previously, the test name was defined by the user pattern. This lead to inconsistent reporting. This patch fixes this because now we report per-test results rather than per-pattern results. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
It is possible that a test is a substring of another. Use a strict pattern so that we execute only the specified test. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
kkourt
force-pushed
the
pr/kkourt/killer-improvements
branch
from
January 9, 2024 14:29
99b8ebd
to
8aef23c
Compare
There are two ways to skip a test in our CI: 1. add it to CiBlacklist in split-tetragon-gotests 2. use t.Skip() CI results report 1., but they do not report 2. This means that skipped tests can go easily unnoticed. To report tests skipped with (2), we need to parse the result files. This patch does exactly that. It adds a new option --enable-detailed-results. If this option is set, we set KeepAllLogs because we need to parse all logs after the tests are finished. The tests we skip with (1) are marked with ⏭️. We introduce a new symbol for the tests that are skipped with (2): ⚡ Parsing the detailed results allows us to also report sub-tests (i.e., tests executed with t.Run()). Here's an output example: ``` ✅ pkg.sensors.tracing.Test_Kprobe_DisableEnablePolicy (total:3 failed:0 skipped:0) 2.680496982s 1m33.952671893s ├─✅ Test_Kprobe_DisableEnablePolicy/sensor 1.05s (1.05s) ├─✅ Test_Kprobe_DisableEnablePolicy/tracing-policy 1.09s (2.14s) └─✅ Test_Kprobe_DisableEnablePolicy 2.56s (4.7s) ⚡ pkg.sensors.tracing.TestKillerOverride32 (total:1 failed:0 skipped:1) 130.759191ms 1m34.083431084s ⚡ pkg.sensors.tracing.TestKillerSignal32 (total:1 failed:0 skipped:1) 132.393451ms 1m34.215824535s ⚡ pkg.sensors.tracing.TestKillerOverrideBothBits (total:1 failed:0 skipped:1) 119.455061ms 1m34.335279596s ⚡ pkg.sensors.tracing.TestKillerOverride (total:1 failed:0 skipped:1) 121.255148ms 1m34.456534744s ⚡ pkg.sensors.tracing.TestKillerSignal (total:1 failed:0 skipped:1) 136.665421ms 1m34.593200165s ✅ pkg.sensors.tracing.TestKillerMulti (total:1 failed:0 skipped:0) 132.761861ms 1m34.725962026s ``` Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
Signed-off-by: cilium-renovate[bot] <134692979+cilium-renovate[bot]@users.noreply.github.com>
kkourt
force-pushed
the
pr/kkourt/killer-improvements
branch
from
January 10, 2024 07:52
8aef23c
to
e0ee8d3
Compare
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
olsajiri
approved these changes
Jan 10, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This was referenced Jan 10, 2024
restarted failed e2e test (see #1954) for details. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims address the fact that our killer sensor tests were always skipped and we never noticed.
The reason was that our CI kernels were not configured with
CONFIG_BPF_KPROBE_OVERRIDE
. This was fixed in cilium/little-vm-helper-images#286.Adding the new kernel images (#1907) lead to some test failures that are meant to be addressed in this PR. This was because our CI did not have a ia32 libc: this is addressed by compiling the ia32 program statically
The only way to note that the tests were skipped using
t.Skip()
was to execute them manually and check the logs. This is not ideal, so this PR adds support to the vmtests for providing detailed results that show what tests are actually skipped and what tests are not.We introduce a new symbol for the tests that are skipped using
t.Skip()
: ⚡Parsing the detailed results allows us to also report sub-tests (i.e., tests executed with t.Run()).
Here's an output example:
Note that above is just an example. Killer tests are no longer skipped in kernels other than 4.19:
A subsequent PR (#1953) will add:
fmod_ret
for kernels that do not provideCONFIG_BPF_KPROBE_OVERRIDE
.fmod_ret
andbpf_override_return
in our CI kernels whereCONFIG_BPF_KPROBE_OVERRIDE
is set.