tetragon icon indicating copy to clipboard operation
tetragon copied to clipboard

tests/kprobe: handle expected failure more intelligently

Open willfindlay opened this issue 3 years ago • 2 comments

Some of our filter tests expect the absence of certain events. This was being checked by ensuring that a stub event checker did not match. However, this would result in confusing logs and longer test runs since the checker would automatically retry 20 times on failure.

One obvious way to improve this is to use a FnEventChecker that expects an event not to match. This commit introduces such a checker to kprobe_test.go. If there is a need to reuse this later in other tests we can move this out of kprobe_test.go or even make a dedicated MultiEventChecker type for it. However this should be fine for now.

Signed-off-by: William Findlay [email protected]

willfindlay avatar May 30 '22 16:05 willfindlay

@kkourt I can probably just do it here, I see TestChecker got merged already.

willfindlay avatar Jun 08 '22 12:06 willfindlay

@kkourt I can probably just do it here, I see TestChecker got merged already.

Up to you! :)

kkourt avatar Jun 08 '22 13:06 kkourt