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

rebase of https://github.com/aquasecurity/tracee/pull/3638 #3683

Merged
merged 3 commits into from
Nov 13, 2023

Conversation

rafaeldtinoco
Copy link
Contributor

@rafaeldtinoco rafaeldtinoco commented Nov 13, 2023

Close: #3440

- add coolDown to sleep before to run the next test.
- change runCmd to receive the number of expected events.
- ExpectAnyOfEvts (ExpectAnyOfEach before) now call runCmd passing 1 as
  expected events.
- eventBuffer.clear() now sets a new empty slice for it, instead of
  relying on the old underlying array.
- replaced copyActualEvents() with eventBuffer.getCopy().
- refactored test functions, improved comments and logs.
Updated the Tracee integration tests to address a bug with the
time.After usage. Previously, at each iteration of the loop, the
time.After was reset whenever its corresponding select clause was
reached. This behavior resulted in the creation of a new timer on each
loop iteration without freeing the previous one, leading to a memory
leak.

The solution involved replacing time.After with a dedicated
timeoutTicker, ensuring consistent timeout handling without unnecessary
resource consumption.
Return all errors to the main test loop to check and abort the tracee
execution in the correct way.

This also:

- Introduces cmdEvents.waitFor duration as a guarantee before starting
  to collect events after executing a command.
- Changes the following tests to be certain of the events collected:
  . pid: trace events from pid 1
  . pid: event: args: trace event sched_switch with args from pid 0
  . pid: trace new (should be empty)
@rafaeldtinoco rafaeldtinoco merged commit 0ddbab5 into aquasecurity:main Nov 13, 2023
31 checks passed
@rafaeldtinoco rafaeldtinoco deleted the pr3638-without-colors branch November 13, 2023 14:56
@geyslan
Copy link
Member

geyslan commented Nov 20, 2023

Thanks for taking care of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integration tests timeout
2 participants