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 appsec tests in 8.1-8.3 #2974

Merged
merged 1 commit into from
Nov 28, 2024
Merged

Fix appsec tests in 8.1-8.3 #2974

merged 1 commit into from
Nov 28, 2024

Conversation

cataphract
Copy link
Contributor

Description

The use of pipe() creates an extra file descriptor which makes the helper unable to find the correct pipe file descriptor. While this could perhaps be improved by telling the helper explicitly the id of the correct file descriptor, it's probably better to swap write() calls of reading invalid addresses with mincore().

See #2942 , which broke the tests

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@cataphract cataphract requested a review from a team as a code owner November 22, 2024 12:17
@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.80%. Comparing base (35d1665) to head (21dcf99).
Report is 22 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2974      +/-   ##
============================================
- Coverage     74.82%   74.80%   -0.02%     
  Complexity     2741     2741              
============================================
  Files           110      110              
  Lines         10863    10863              
============================================
- Hits           8128     8126       -2     
- Misses         2735     2737       +2     
Flag Coverage Δ
tracer-php 74.80% <ø> (-0.02%) ⬇️

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

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35d1665...21dcf99. Read the comment docs.

@cataphract cataphract force-pushed the glopes/fix-appsec-test-pipe branch from f451104 to 627c44a Compare November 22, 2024 12:29
@Anilm3
Copy link
Contributor

Anilm3 commented Nov 22, 2024

The use of pipe() creates an extra file descriptor which makes the helper unable to find the correct pipe file descriptor. While this could perhaps be improved by telling the helper explicitly the id of the correct file descriptor, it's probably better to swap write() calls of reading invalid addresses with mincore().

I suppose you meant mock helper.

@pr-commenter
Copy link

pr-commenter bot commented Nov 22, 2024

Benchmarks [ tracer ]

Benchmark execution time: 2024-11-26 22:04:27

Comparing candidate commit 21dcf99 in PR branch glopes/fix-appsec-test-pipe with baseline commit 35d1665 in branch master.

Found 2 performance improvements and 2 performance regressions! Performance is the same for 174 metrics, 0 unstable metrics.

scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache

  • 🟩 execution_time [-9.093µs; -6.707µs] or [-5.285%; -3.898%]

scenario:PDOBench/benchPDOBaseline-opcache

  • 🟥 execution_time [+13.469µs; +18.769µs] or [+7.501%; +10.453%]

scenario:TraceFlushBench/benchFlushTrace

  • 🟥 execution_time [+1000.000ns; +1000.000ns] or [+100.000%; +100.000%]

scenario:TraceSerializationBench/benchSerializeTrace

  • 🟩 execution_time [-12.638µs; -7.162µs] or [-6.224%; -3.527%]

@cataphract cataphract force-pushed the glopes/fix-appsec-test-pipe branch 2 times, most recently from 4b6cd39 to 9fd6b9e Compare November 22, 2024 16:17
@cataphract cataphract requested a review from Anilm3 November 22, 2024 16:18
@cataphract cataphract force-pushed the glopes/fix-appsec-test-pipe branch from 9fd6b9e to d07d32a Compare November 26, 2024 16:32
The use of pipe() creates an extra file descriptor which makes the
helper unable to find the correct pipe file descriptor. While this could
perhaps be improved by telling the helper explicitly the id of the
correct file descriptor, it's probably better to swap write() calls of
reading invalid addresses with mincore().
@cataphract cataphract force-pushed the glopes/fix-appsec-test-pipe branch from d07d32a to 21dcf99 Compare November 26, 2024 21:35
Copy link
Contributor

@Anilm3 Anilm3 left a comment

Choose a reason for hiding this comment

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

The linux logic looks good to me. Hopefully someone can double check the macos bit...

@cataphract cataphract merged commit 0c6532b into master Nov 28, 2024
482 of 530 checks passed
@cataphract cataphract deleted the glopes/fix-appsec-test-pipe branch November 28, 2024 10:55
@cataphract cataphract restored the glopes/fix-appsec-test-pipe branch November 28, 2024 10:55
@cataphract cataphract deleted the glopes/fix-appsec-test-pipe branch November 28, 2024 10:55
@github-actions github-actions bot added this to the 1.6.0 milestone Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants