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/test): use correct iterator type in plugin tests #1987

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

LucaGuerra
Copy link
Contributor

What type of PR is this?

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

/kind bug

Any specific area of the project related to this PR?

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

/area libsinsp

/area tests

Does this PR require a change in the driver versions?

No

What this PR does / why we need it:

It is incorrect to do something.find("...") != something_else.end(). Some debug versions will error on this. Fix this in tests.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Luca Guerra <luca@guerra.sh>
Copy link

github-actions bot commented Aug 1, 2024

Perf diff from master - unit tests

     9.19%     +2.03%  [.] sinsp_parser::reset
     4.69%     +1.10%  [.] next
     0.60%     +0.57%  [.] sinsp_evt::get_param
     0.90%     +0.55%  [.] libsinsp::sinsp_suppress::process_event
     4.32%     -0.55%  [.] sinsp_evt::load_params
     0.30%     +0.54%  [.] sinsp_fdtable::find
     8.12%     -0.50%  [.] sinsp::next
     1.44%     -0.50%  [.] scap_next
     1.69%     +0.49%  [.] std::_Hashtable<long, std::pair<long const, std::shared_ptr<sinsp_threadinfo> >, std::allocator<std::pair<long const, std::shared_ptr<sinsp_threadinfo> > >, std::__detail::_Select1st, std::equal_to<long>, std::hash<long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_find_before_node
     2.04%     -0.45%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release

Perf diff from master - scap file

    14.16%     +6.97%  [.] sinsp_evt_formatter::tostring_withformat
    15.09%     -4.67%  [.] sinsp_filter_check::extract_nocache
     9.50%     -3.70%  [.] std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>
    13.83%     -2.16%  [.] next
     6.36%     +2.10%  [.] sinsp_filter_check::tostring
     3.15%     +2.08%  [.] gzfile_read
     3.18%     +1.92%  [.] sinsp_parser::process_event
     3.68%     +1.77%  [.] main
     9.38%     -1.48%  [.] std::_Hashtable<long, std::pair<long const, std::shared_ptr<sinsp_threadinfo> >, std::allocator<std::pair<long const, std::shared_ptr<sinsp_threadinfo> > >, std::__detail::_Select1st, std::equal_to<long>, std::hash<long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_find_before_node
     2.75%     +0.33%  [.] sinsp_split[abi:cxx11]

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

Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

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

Wow great catch!
/approve

@poiana
Copy link
Contributor

poiana commented Aug 1, 2024

LGTM label has been added.

Git tree hash: 6a1f6f79058e7f063c504fde99683edf28aeb708

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 50.98%. Comparing base (3ce0a2d) to head (ed9a53d).

Files Patch % Lines
userspace/libsinsp/test/plugins.ut.cpp 50.00% 0 Missing and 2 partials ⚠️
userspace/libsinsp/test/state.ut.cpp 0.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #1987    +/-   ##
========================================
  Coverage   50.98%   50.98%            
========================================
  Files         310      310            
  Lines       39612    39612            
  Branches    17793    17482   -311     
========================================
  Hits        20197    20197            
+ Misses      14350    14335    -15     
- Partials     5065     5080    +15     

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

Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

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

/approve

@poiana
Copy link
Contributor

poiana commented Aug 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, LucaGuerra

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Andreagit97,FedeDP,LucaGuerra]

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

@Andreagit97 Andreagit97 added this to the 0.17.3 milestone Aug 1, 2024
@poiana poiana merged commit 2e87063 into falcosecurity:master Aug 1, 2024
43 of 46 checks passed
@LucaGuerra LucaGuerra deleted the fix/test-iterator-end-type branch August 2, 2024 07:47
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.

4 participants