Skip to content

fix(ci): update laravel assertions, skip bailout under valgrind, fix grep#3769

Merged
bwoebi merged 2 commits intomasterfrom
leiyks/fix-ci-laravel-and-bailout-valgrind
Apr 2, 2026
Merged

fix(ci): update laravel assertions, skip bailout under valgrind, fix grep#3769
bwoebi merged 2 commits intomasterfrom
leiyks/fix-ci-laravel-and-bailout-valgrind

Conversation

@Leiyks
Copy link
Copy Markdown
Contributor

@Leiyks Leiyks commented Apr 2, 2026

What

  • Fix test_web_laravel_octane_latest and test_web_laravel_42 regressions: update resource name assertions to use route URI instead of unnamed_route (missed by commit 1111e8073)
  • Fix test_extension_ci: [7.0/7.1]: skip bailout_double_hook_clear.phpt under valgrind — the bailout path bypasses normal span cleanup, causing expected (non-bug) leaks
  • Fix test_extension_ci: [7.4/8.0]: anchor the LEAKED TEST SUMMARY grep to line start to avoid false positives from embedded phrases in valgrind-run-tests.out

Why

Laravel regressions (1111e8073): LaravelIntegration.php was updated to use route URI as the resource name, but two test snapshot assertions still expected unnamed_route in the span name:

  • Laravel/Octane/Latest/CommonScenariosTest.php lines 172, 261
  • Laravel/V4/CommonScenariosTest.php line 189

Bailout valgrind leak (test_extension_ci: [7.0/7.1]): bailout_double_hook_clear.phpt triggers a PHP fatal bailout inside a posthook. On PHP 7.0/7.1, the bailout unwinds without running normal hook/span cleanup, leaving valgrind-visible allocations. This is expected behavior, not a bug. Same pattern as commit 856068ad4.

Grep false positive (test_extension_ci: [7.4/8.0]): Adding the --SKIPIF-- changed the test from PASSING to SKIPPED under valgrind. When a test passes, run-tests.php writes nothing about it; when it skips, additional metadata is written to valgrind-run-tests.out that contains the phrase " valgrind LEAKED TEST SUMMARY. The test still runs in the normal" (with leading spaces) — not the actual section header. The un-anchored grep 'LEAKED TEST SUMMARY' matched this embedded phrase. On 7.0/7.1 on master this was hidden because run-tests.php exited 1 (leaked tests), short-circuiting the && before grep could run.

How

  • Laravel Octane: resource names unnamed_routesimple_view and error
  • Laravel V4: resource name HomeController@dynamicRoute unnamed_routeHomeController@dynamicRoute dynamic_route/{param01}/static/{param02?} (actual route URI)
  • bailout SKIPIF: skip when USE_ZEND_ALLOC=0 && !SKIP_ASAN (valgrind mode, not ASAN), same condition used in 856068ad4
  • Makefile grep: 'LEAKED TEST SUMMARY''^LEAKED TEST SUMMARY' to match only the section header at line start

Testing

  • CI: test_web_laravel_octane_latest expected green
  • CI: test_web_laravel_42 expected green
  • CI: test_extension_ci: [7.0] expected green
  • CI: test_extension_ci: [7.1] expected green
  • CI: test_extension_ci: [7.4] expected green
  • CI: test_extension_ci: [8.0] expected green

…algrind

- Laravel Octane/Latest CommonScenariosTest: update two resource name
  assertions introduced by 1111e80 (unnamed routes now use route URI
  instead of 'unnamed_route' suffix): simple_view and error routes now
  produce 'simple_view' and 'error' respectively.

- Laravel V4 CommonScenariosTest: update dynamic route resource name
  assertion for the same reason — Laravel 4.2 has a uri() method so it
  hits the new elseif branch; expected value is now
  'dynamic_route/{param01}/static/{param02?}'.

- bailout_double_hook_clear.phpt: add --SKIPIF-- to skip under valgrind
  (USE_ZEND_ALLOC=0). The test triggers a PHP fatal bailout inside a
  posthook which bypasses normal span/hook cleanup, causing an expected
  valgrind LEAKED TEST SUMMARY. The test still runs in the normal
  (non-valgrind) pass. Pattern matches the guard added in 856068a for
  background-sender tests.
@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 Bot commented Apr 2, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 60.68% (+0.04%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e229ffd | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

The check `! grep -e 'LEAKED TEST SUMMARY'` was too broad: it matched
the phrase as a substring anywhere in valgrind-run-tests.out, including
inside the PHPINFO section where run-tests.php writes phpinfo() output.

Before this fix, the check was masked on PHP 7.0/7.1 because
`bailout_double_hook_clear.phpt` leaked under valgrind, causing
run-tests.php to exit 1, which short-circuited the && and skipped grep.
After adding the SKIPIF to that test, run-tests.php exits 0 and grep
runs, finding 6 embedded occurrences that were always there.

The actual section header written by run-tests.php is:
  LEAKED TEST SUMMARY
at line start with no leading spaces. The false-positive lines look like:
  "  valgrind LEAKED TEST SUMMARY. The test still runs in the normal"
with leading spaces — clearly not the section header.

Anchoring with ^ matches only the real header.
@Leiyks Leiyks changed the title fix(ci): update laravel test assertions and skip bailout test under valgrind fix(ci): update laravel assertions, skip bailout under valgrind, fix grep Apr 2, 2026
@Leiyks Leiyks marked this pull request as ready for review April 2, 2026 13:54
@Leiyks Leiyks requested a review from a team as a code owner April 2, 2026 13:54
Copy link
Copy Markdown
Collaborator

@bwoebi bwoebi left a comment

Choose a reason for hiding this comment

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

Thank you!

@bwoebi bwoebi merged commit 5bc467b into master Apr 2, 2026
2100 checks passed
@bwoebi bwoebi deleted the leiyks/fix-ci-laravel-and-bailout-valgrind branch April 2, 2026 18:35
@github-actions github-actions Bot added this to the 1.18.0 milestone Apr 2, 2026
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.

2 participants