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

fix(libsinsp_e2e): make tests more stable #2075

Conversation

therealbobo
Copy link
Contributor

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area API-version

/area build

/area CI

/area driver-kmod

/area driver-bpf

/area driver-modern-bpf

/area libscap-engine-bpf

/area libscap-engine-gvisor

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-savefile

/area libscap

/area libpman

/area libsinsp

/area tests

/area proposals

Does this PR require a change in the driver versions?

/version driver-API-version-major

/version driver-API-version-minor

/version driver-API-version-patch

/version driver-SCHEMA-version-major

/version driver-SCHEMA-version-minor

/version driver-SCHEMA-version-patch

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@poiana
Copy link
Contributor

poiana commented Sep 20, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: therealbobo
Once this PR has been reviewed and has the lgtm label, please assign gnosek for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

github-actions bot commented Sep 20, 2024

Perf diff from master - unit tests

     5.09%     +1.15%  [.] next
     1.66%     -0.75%  [.] std::vector<sinsp_evt_param, std::allocator<sinsp_evt_param> >::emplace_back<sinsp_evt*, unsigned int&, char const*, unsigned long&>
    10.54%     -0.74%  [.] sinsp_parser::reset
     4.39%     +0.61%  [.] gzfile_read
     0.67%     +0.55%  [.] 0x00000000000e9380
     4.07%     -0.53%  [.] sinsp_thread_manager::get_thread_ref
     2.46%     +0.46%  [.] sinsp_thread_manager::find_thread
     1.02%     -0.45%  [.] scap_next
     1.20%     -0.43%  [.] sinsp_utils::find_longest_matching_evt_param
     2.15%     +0.40%  [.] scap_event_decode_params

Heap diff from master - unit tests

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Benchmarks diff from master

Comparing gbench_data.json to /root/actions-runner/_work/libs/libs/build/gbench_data.json
Benchmark                                                         Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------------
BM_sinsp_split_mean                                            +0.0012         +0.0012           149           150           149           150
BM_sinsp_split_median                                          -0.0014         -0.0014           149           149           149           149
BM_sinsp_split_stddev                                          +0.3815         +0.3801             1             1             1             1
BM_sinsp_split_cv                                              +0.3799         +0.3785             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  -0.0728         -0.0728            44            41            44            41
BM_sinsp_concatenate_paths_relative_path_median                -0.0808         -0.0808            44            41            44            41
BM_sinsp_concatenate_paths_relative_path_stddev                -0.9493         -0.9494             2             0             2             0
BM_sinsp_concatenate_paths_relative_path_cv                    -0.9453         -0.9454             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0170         -0.0170            18            17            18            17
BM_sinsp_concatenate_paths_empty_path_median                   -0.0250         -0.0250            18            17            18            17
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.3138         -0.3138             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.3020         -0.3020             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  -0.0299         -0.0299            45            44            45            44
BM_sinsp_concatenate_paths_absolute_path_median                -0.0325         -0.0325            45            44            45            44
BM_sinsp_concatenate_paths_absolute_path_stddev                +0.3013         +0.3007             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_cv                    +0.3414         +0.3408             0             0             0             0
BM_sinsp_split_container_image_mean                            +0.0348         +0.0348           350           362           350           362
BM_sinsp_split_container_image_median                          +0.0341         +0.0341           350           362           350           362
BM_sinsp_split_container_image_stddev                          +0.3789         +0.3733             1             2             1             2
BM_sinsp_split_container_image_cv                              +0.3325         +0.3271             0             0             0             0

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.58%. Comparing base (0eb7be3) to head (66c8788).
Report is 48 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2075      +/-   ##
==========================================
- Coverage   73.58%   73.58%   -0.01%     
==========================================
  Files         253      253              
  Lines       31869    31869              
  Branches     5653     5640      -13     
==========================================
- Hits        23452    23451       -1     
+ Misses       8416     8401      -15     
- Partials        1       17      +16     
Flag Coverage Δ
libsinsp 73.58% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@therealbobo therealbobo force-pushed the therealbobo-fix-libsinsp-e2e branch 3 times, most recently from a12bc9c to adb8c8b Compare September 21, 2024 11:32
@poiana poiana added size/L and removed size/M labels Sep 21, 2024
capturing.stop_capture();
// This lseek is just used to be sure that all the events
// created in the run_function were consumed.
lseek(-1,-1,-1);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd use something less error prone (ie: perhaps there can be something else in the system that calls lseek(-1):

  • open a "lock file" like m_fd = open("/tmp/__test_running")
  • at the end, close(m_fd)
  • wait for the close syscall event on m_fd for our TID

WDYT? It seems easier to understand and safer.

@therealbobo therealbobo force-pushed the therealbobo-fix-libsinsp-e2e branch 2 times, most recently from f4ebf18 to 899d1a8 Compare September 25, 2024 10:24
@FedeDP
Copy link
Contributor

FedeDP commented Sep 25, 2024

/milestone TBD

@poiana poiana added this to the TBD milestone Sep 25, 2024
@therealbobo therealbobo force-pushed the therealbobo-fix-libsinsp-e2e branch 2 times, most recently from 602f84c to e6a89aa Compare September 25, 2024 21:24
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
@therealbobo therealbobo closed this Oct 7, 2024
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.

3 participants