[PROF-13510] Add Ruby 4 heap profiling test variants#89
Conversation
**What does this PR do?** This PR adds Ruby 4 heap profiling test variants. As per DataDog/dd-trace-rb#5201, we need a different implementation of heap profiling on Ruby 4, so we want to validate it's still sane with prof-correctness. These variants are effectively the same as the regular ones but: * Replace Ruby 3.3 with Ruby 4.0 * Point to the branch from DataDog/dd-trace-rb#5201 (we'll need to change this back to master once landed) * Set the `DD_PROFILING_EXPERIMENTAL_HEAP_RUBY4_ENABLED` env variable we're using to gate the new feature * Update the `expected_profile.json` to take into account that object allocation in Ruby 4 produces a slightly different stack trace (there's no `new` method on the stack -- it gets inlined into the caller) **Motivation:** Validate Ruby 4 heap profiling. **Additional Notes:** There's still a few anomalies in the results we're looking into... **How to test the change?** Run as usual!
We're using `go test` here [which defaults to 10 minutes](https://pkg.go.dev/cmd/go#hdr-Testing_flags). Our Ruby tests are running for 50 seconds each by default, so the addition of extra tests pushed us over the limit. I've raised the limit to 20 minutes which should be enough. We could disable it in the future, but I do like the reminder that we are taking too long and might need to do something else instead ;)
20287c7 to
ee345fb
Compare
| ] | ||
| }, | ||
| { | ||
| "regular_expression": "^<main>;each;<main>;times;<main>;b;new$", |
There was a problem hiding this comment.
💭 I can't remember what is the logic on having new or not in the stack
There was a problem hiding this comment.
That's an actual upstream behavior change -- we fixed up our tests in DataDog/dd-trace-rb#4656 and the upstream change (with a really nice explanation) is ruby/ruby#13080 .
|
Going ahead and merging this one! Two final notes:
|
What does this PR do?
This PR adds Ruby 4 heap profiling test variants. As per DataDog/dd-trace-rb#5201, we need a different implementation of heap profiling on Ruby 4, so we want to validate it's still sane with prof-correctness.
These variants are effectively the same as the regular ones but:
Point to the branch from [PROF-13510] Heap profiling for ruby 4.x dd-trace-rb#5201 (we'll need to change this back to master once landed)No longer neededSet theNo longer neededDD_PROFILING_EXPERIMENTAL_HEAP_RUBY4_ENABLEDenv variable we're using to gate the new featureexpected_profile.jsonto take into account that object allocation in Ruby 4 produces a slightly different stack trace (there's nonewmethod on the stack -- it gets inlined into the caller)Motivation:
Validate Ruby 4 heap profiling.
Additional Notes:
There's still a few anomalies in the results we're looking into...
How to test the change?
Run as usual!