Conversation
…#1986) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Martin Linzmayer <martin.linzmayer@sentry.io> Co-authored-by: Alex Bouma <alex@bouma.me>
# Conflicts: # src/Metrics/Metrics.php
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| $this->assertCount(1, $transport->getEvents()); | ||
| $this->assertSame('I was dropped :(', $transport->getEvents()[0]->getLogs()[0]->getBody()); | ||
| $this->assertCount(1, StubTransport::$events); | ||
| $this->assertSame('I was dropped :(', StubTransport::$events[0]->getLogs()[0]->getBody()); |
There was a problem hiding this comment.
Static $events not cleared causes flaky test assertions
Medium Severity
The refactoring from an anonymous class with an instance $events property to StubTransport with a static $events property introduces cross-test contamination. StubTransport::$events is never cleared in LogsHandlerTest — neither in setUp() nor in the test itself — so events from other test classes (e.g., TraceMetricsTest) that use the same static array can leak in. The assertCount(1, ...) assertion will fail if any prior test class left stale events in StubTransport::$events.


merge
masterinto5.xbranch