Skip to content

Add Ruby EVP fork isolation system test#7226

Draft
leoromanovsky wants to merge 2 commits into
mainfrom
leo.romanovsky/ffl-2446-ruby-prefork-system-tests
Draft

Add Ruby EVP fork isolation system test#7226
leoromanovsky wants to merge 2 commits into
mainfrom
leo.romanovsky/ffl-2446-ruby-prefork-system-tests

Conversation

@leoromanovsky

@leoromanovsky leoromanovsky commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Motivation

Ruby EVP flagevaluation has fork/prefork behavior that is hard to prove from unit tests alone: the child process must not flush parent-process queued EVP evaluation state. This PR pre-wires Rails72 system-test coverage for that runtime path without activating it yet.

Changes

  • Add a Rails72 /ffe/fork-isolation endpoint that evaluates one flag in the parent process, evaluates another in a forked child, and flushes OpenFeature exposure and EVP flagevaluation writers deterministically.
  • Add a Ruby-specific EVP flagevaluation system test asserting the child-emitted batch does not contain the parent flag.
  • Keep the shared Ruby EVP flagevaluation manifest disabled as missing_feature (FFL-2446).
  • Keep the new Ruby fork-isolation test disabled for Rails72 until DataDog/dd-trace-rb#5896 lands.
  • Pin Rails72 openfeature-sdk to >= 0.5.1 so provider hooks are available when Ruby EVP coverage is activated.

Decisions

  • Do not activate Ruby EVP system-tests in this PR. The Ruby tracer implementation is still in DataDog/dd-trace-rb#5896, so merging activation into system-tests first would advertise coverage before the default Ruby tracer can satisfy it.
  • Keep the fork/prefork regression proof in system-tests because it validates real Rails + OpenFeature + tracer + Agent EVP dataflow across process boundaries. Ruby repo unit tests still cover the writer-level fork reset behavior, but they do not prove the full weblog/Agent payload path.
  • Avoid asserting that the parent never emits its own event; the harness legitimately flushes the parent process later. The test only rejects parent state appearing in the child flush batch.

Validation

Validation was run locally against DataDog/dd-trace-rb#5896 by building Rails72 with that local Ruby tracer source:

  • ./build.sh --library ruby --weblog-variant rails72 --images weblog --binary-path /tmp/system-tests-ruby-binary
  • Verified image installed datadog 2.37.0.dev, openfeature-sdk 0.5.1, libdatadog 36.0.0.1.0.
  • TEST_LIBRARY=ruby ./run.sh FEATURE_FLAGGING_AND_EXPERIMENTATION tests/ffe/test_flag_eval_evp_ruby.py::Test_FFE_EVP_Flagevaluation_Ruby_Fork_Isolation --library ruby -> 1 passed in 24.65s
    - TEST_LIBRARY=ruby ./run.sh FEATURE_FLAGGING_AND_EXPERIMENTATION tests/ffe/test_flag_eval_evp.py tests/ffe/test_flag_eval_evp_ruby.py --library ruby -> 8 passed, 1 skipped in 46.39s
  • Ruby syntax checks for Rails72 controllers/routes.
  • python3 -m compileall -q tests/ffe/test_flag_eval_evp_ruby.py
  • venv/bin/ruff check tests/ffe/test_flag_eval_evp_ruby.py
  • targeted mypy for tests/ffe/test_flag_eval_evp_ruby.py and tests/ffe/test_flag_eval_evp.py
  • venv/bin/python utils/manifest/validate.py
  • venv/bin/yamllint -s manifests/ruby.yml
  • git diff --check

@github-actions

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

tests/ffe/test_flag_eval_evp_ruby.py                                    @DataDog/feature-flagging-and-experimentation-sdk @DataDog/system-tests-core
manifests/ruby.yml                                                      @DataDog/ruby-guild @DataDog/asm-ruby
utils/build/docker/ruby/rails72/Gemfile                                 @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/rails72/Gemfile.lock                            @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/rails72/app/controllers/internal_controller.rb  @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/rails72/app/controllers/open_feature_controller.rb  @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/rails72/config/routes.rb                        @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Jun 28, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

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

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