Skip to content

[NO-TICKET] Reduce Ruby heap test scenario variation - #154

Draft
ivoanjo wants to merge 1 commit into
mainfrom
ivoanjo/reduce-ruby-heap-scenario-variations
Draft

[NO-TICKET] Reduce Ruby heap test scenario variation#154
ivoanjo wants to merge 1 commit into
mainfrom
ivoanjo/reduce-ruby-heap-scenario-variations

Conversation

@ivoanjo

@ivoanjo ivoanjo commented Jun 10, 2026

Copy link
Copy Markdown
Member

What does this PR do?

This PR adds an additional GC trigger and sleep at the beginning of the Ruby heap test scenarios so that the GC and dynamic sampling rate start with a clean slate.

Motivation:

We've seen these tests flake due to run-to-run variation. Rather than loosening the error ranges in the expected_profile.json files, I experimented locally with this "try to create a clean slate" approach and I was getting more accurate results without needing to loosen errors.

In particular the "ruby_heap" and "ruby_heap_r4" tests don't do a lot of allocations (e.g. when compared to "ruby_heap_highload" and "ruby_heap_highload_r4") and thus cause a lot more run-to-run variation.

(Which kinda makes sense? The less allocations, the less the dynamic sampling rate has to work with, and with small numbers we get more noise in the reads)

Additional Notes:

N/A

How to test the change?

Green CI is the target! If not, we'll keep at it :)

**What does this PR do?**

This PR adds an additional GC trigger and sleep at the beginning of
the Ruby heap test scenarios so that the GC and dynamic sampling rate
start with a clean slate.

**Motivation:**

We've seen these tests flake due to run-to-run variation. Rather than
loosening the error ranges in the `expected_profile.json` files,
I experimented locally with this "try to create a clean slate" approach
and I was getting more accurate results without needing to loosen
errors.

In particular the "ruby_heap" and "ruby_heap_r4" tests don't do a lot of
allocations (e.g. when compared to "ruby_heap_highload" and
"ruby_heap_highload_r4") and thus cause a lot more run-to-run variation.

(Which kinda makes sense? The less allocations, the less the dynamic
sampling rate has to work with, and with small numbers we get more noise
in the reads)

**Additional Notes:**

N/A

**How to test the change?**

Green CI is the target! If not, we'll keep at it :)
@ivoanjo
ivoanjo requested a review from a team as a code owner June 10, 2026 17:54
@datadog-prod-us1-5

Copy link
Copy Markdown

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

prof-correctness | ruby / scenarios 3/4   View in Datadog   GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 15d413e | Docs | Datadog PR Page | Give us feedback!

@ivoanjo

ivoanjo commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

Hmm looks like this wasn't enough yet... Will keep at it

@ivoanjo
ivoanjo marked this pull request as draft June 10, 2026 18:00
r1viollet pushed a commit that referenced this pull request Jul 3, 2026
**What does this PR do?**

This PR marks all Ruby heap-related tests as flaky, renaming the
folders so they don't run by default in CI.

**Motivation:**

This PR attempts to "stop the bleeding" relating to the Ruby Heap tests
being flaky: it's really annoying that these failures keep showing up
in other prof-correctness where nothing changed for Ruby.

I've started #154 to try
to actually fix things, but until we have a good fix in place, let's
avoid the annoyance to everyone else.

**Additional Notes:**

N/A

**How to test the change?**

Validate that `ruby_heap` tests are no longer running in CI (and CI is
still green).
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.

1 participant