Skip to content

Conversation

@p-datadog
Copy link
Member

What does this PR do?

Adds state resets to crash tracking and process discovery tests

Motivation:
Existing tests are failing with the changes in #5159

Change log entry
None

Additional Notes:
We already have tests in master for after fork money patcher that reset the list of registered after fork handlers (such as the ones set by crash tracking and process discovery). Why these have not ever failed is a mystery to me. Maybe this has to do with how tests are grouped in CI.

Regardless, in #5159 I now use the monkey patcher for telemetry and this is causing test failures because crash tracking and process discovery assume that their after fork handlers have been installed somehow (and they usually get installed by the library itself when it gets loaded, or coincidentally by other tests in my local test runs) but the resets in telemetry and/or the monkey patch unit tests themselves clear out those handlers.

This PR adds state resets to the existing tests.

How to test the change?
Existing CI + #5159

@p-datadog p-datadog requested a review from a team as a code owner December 19, 2025 19:48
@github-actions github-actions bot added the dev/testing Involves testing processes (e.g. RSpec) label Dec 19, 2025
@p-datadog p-datadog changed the title Fix global state dependency in crashtracking and process discovery tests DEBUG-4548 Fix global state dependency in crashtracking and process discovery tests Dec 19, 2025
@datadog-official
Copy link

datadog-official bot commented Dec 19, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 100.00%
Overall Coverage: 95.26% (-0.00%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1497ca2 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@pr-commenter
Copy link

pr-commenter bot commented Dec 19, 2025

Benchmarks

Benchmark execution time: 2025-12-19 20:50:25

Comparing candidate commit 1497ca2 in PR branch after-fork-test-state with baseline commit 2cb8be7 in branch master.

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

@p-datadog p-datadog merged commit 9d9a780 into master Dec 22, 2025
331 checks passed
@p-datadog p-datadog deleted the after-fork-test-state branch December 22, 2025 17:07
@github-actions github-actions bot added this to the 2.24.0 milestone Dec 22, 2025
p-datadog pushed a commit that referenced this pull request Dec 22, 2025
* worker-shutdown-race:
  standard
  standard
  exclude JRuby 10 JIT threads from thread leaker reporting
  Exclude JRuby file descriptors from leak reporting
  DEBUG-4548 Fix global state dependency in crashtracking and process discovery tests (#5175)
  fix quoting in rake command (#5177)
  Update system tests (incl. `bin/rails` fix for 2.6)
  Update system tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev/testing Involves testing processes (e.g. RSpec)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants