Skip to content

Conversation

@smaddock
Copy link
Contributor

@smaddock smaddock commented May 19, 2025

Curl

There are intermittent PHPUnit errors in the Instrumentation/Curl library for the curl_multi integration tests stating the asserted span count is 1 instead of 2. Tracking it down, the WeakReference the for the cURL handle sub-span was sometimes being destroyed too early, causing finishMultiSpan() to bail, the scope to never detach, and the span to never be added to storage. I believe it is due to:

The original object will be destroyed when the refcount for it drops to zero; creating weak references does not increase the refcount of the object being referenced. ref

Changing the sub-span to be directly assigned to the handles WeakMap resolves the test failures. make all passes with this change, but I do not know if there are other consequences.

cc @intuibase

Edit: split OpenAIPHP component to #375

@smaddock smaddock requested a review from a team as a code owner May 19, 2025 19:35
@codecov
Copy link

codecov bot commented May 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.15%. Comparing base (3f003f3) to head (4874f3d).
Report is 12 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #371      +/-   ##
============================================
+ Coverage     81.68%   82.15%   +0.46%     
- Complexity     1741     1865     +124     
============================================
  Files           133      137       +4     
  Lines          7307     7698     +391     
============================================
+ Hits           5969     6324     +355     
- Misses         1338     1374      +36     
Flag Coverage Δ
Aws 92.59% <ø> (ø)
Context/Swoole 0.00% <ø> (ø)
Instrumentation/CakePHP 20.40% <ø> (ø)
Instrumentation/CodeIgniter 73.55% <ø> (ø)
Instrumentation/Curl 90.42% <100.00%> (?)
Instrumentation/Doctrine 92.72% <ø> (ø)
Instrumentation/ExtAmqp 88.48% <ø> (ø)
Instrumentation/ExtRdKafka 86.11% <ø> (ø)
Instrumentation/Guzzle 69.13% <ø> (ø)
Instrumentation/HttpAsyncClient 78.04% <ø> (ø)
Instrumentation/IO 70.68% <ø> (ø)
Instrumentation/Laravel 63.91% <ø> (ø)
Instrumentation/MongoDB 74.28% <ø> (ø)
Instrumentation/MySqli 95.81% <ø> (ø)
Instrumentation/PDO 94.21% <ø> (ø)
Instrumentation/Psr14 76.47% <ø> (ø)
Instrumentation/Psr15 89.15% <ø> (ø)
Instrumentation/Psr16 97.50% <ø> (ø)
Instrumentation/Psr18 77.46% <ø> (ø)
Instrumentation/Psr3 67.01% <ø> (ø)
Instrumentation/Psr6 97.61% <ø> (ø)
Instrumentation/Slim 86.11% <ø> (ø)
Instrumentation/Symfony 84.74% <ø> (ø)
Instrumentation/Yii 77.50% <ø> (ø)
Logs/Monolog 100.00% <ø> (ø)
Propagation/Instana 98.11% <ø> (ø)
Propagation/ServerTiming 100.00% <ø> (?)
Propagation/TraceResponse 100.00% <ø> (ø)
ResourceDetectors/Azure 91.66% <ø> (ø)
ResourceDetectors/Container 93.02% <ø> (ø)
Sampler/RuleBased 33.51% <ø> (ø)
Shims/OpenTracing 92.45% <ø> (ø)
Symfony 87.81% <ø> (ø)
Utils/Test 87.53% <ø> (ø)

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

Files with missing lines Coverage Δ
...c/Instrumentation/Curl/src/CurlInstrumentation.php 93.75% <100.00%> (ø)

... and 5 files 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 3f003f3...4874f3d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@smaddock smaddock changed the title Fixes for PHPUnit errors in the Curl and OpenAIPHP instrumentation libraries Fixes for PHPUnit errors in the Curl instrumentation library May 21, 2025
@bobstrecansky bobstrecansky merged commit 9c3ecc9 into open-telemetry:main Jun 11, 2025
133 of 136 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in PHP Prioritized Backlog Jun 11, 2025
@smaddock smaddock deleted the curl-openai-qa branch June 11, 2025 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants