-
Notifications
You must be signed in to change notification settings - Fork 474
tetragon: handle test events sequentially #4291
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
The test infrastructure that monitors the ring buffers and handles events during tests does not mirror how tetragon does this in production. When monitoring events for real, we have an event cache channel that the ring buffer monitors write to, and the event handler reads from. This means that events are handled sequentially. In the test infrastructure, the ring buffer monitors handle the events directly, resulting in two events able to be handle concurrently, which causes problems. This commit introduces an event cache to the test infrastructure and uses that to handle events sequentially, avoiding the problem. Signed-off-by: Kevin Sheldrake <[email protected]>
e7ab737 to
68c069e
Compare
|
ARM failure is a known issue. |
| errChan <- fmt.Errorf("error loop event function returned: %w", err) | ||
| break | ||
| } | ||
| if complChecker.Done() || ctxPerfRing.Err() != nil { |
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.
What happens if there is a ctxPerfRing error? Do we propagate it to the test somehow?
The benefit of having t *testing.T is that we can just fail the test, but we do not seem to be doing that.
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.
We use ctxPerfRing only to indicate that we are done. I don't think we need to propagate any errors. What errors did you have in mind?
| errChan <- fmt.Errorf("error loop event function returned: %w", err) | ||
| break | ||
| } | ||
| if complChecker.Done() || ctxBPFRing.Err() != nil { |
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.
Similarly for this error here.
The test infrastructure that monitors the ring buffers and handles events during tests does not mirror how tetragon does this in production. When monitoring events for real, we have an event cache channel that the ring buffer monitors write to, and the event handler reads from. This means that events are handled sequentially.
In the test infrastructure, the ring buffer monitors handle the events directly, resulting in two events able to be handle concurrently, which causes problems. This commit introduces an event cache to the test infrastructure and uses that to handle events sequentially, avoiding the problem.