Stabilize OpenFeature provider event tests - #12278
Conversation
Wait for provider events instead of polling asynchronous SDK state with a one-second deadline. Initialize recovery coverage synchronously and remove the unused Awaitility test dependency. Environment: Datadog workspace
This comment has been minimized.
This comment has been minimized.
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3eebb73ff0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
More details
The tests now wait for provider events instead of repeated state checks. The changed logic keeps the same state checks and has no reportable defect.
🤖 Datadog Autotest · Commit 3eebb73 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
Wrap the provider event futures with verifiable consumers so deterministic waiting continues to reject duplicate transition events. Environment: Datadog workspace
Motivation
ProviderTestis marked flaky after repeated failures onmasterARM64 CI jobs under Semeru 17 and JDK 27. The affected tests,testSetProvider()andtestNullConfigurationAfterReadyTransitionsToErrorAndRecovers(), polled provider state with a one-second deadline. The configuration gateway already retains and replays the latest configuration, so the failures did not indicate a lost update; they occurred when shared-runner scheduling delayed OpenFeature's asynchronous worker or event handler past that deadline. The tests were therefore measuring executor latency rather than the provider contract.Changes
The asynchronous tests now complete futures from the actual OpenFeature ready, error, and configuration-changed events and assert provider state after the expected event arrives.
testSetProviderAndWait()waits for its submitted initialization operation, while the recovery-state test preloads configuration and initializes synchronously before exercising error and recovery transitions. The ten-second future deadline remains only as hang protection, not as a polling window. Since this was the module's last Awaitility usage, the unused test dependency is removed.Decisions
Production code is unchanged because the live failures point to test orchestration, not a runtime provider defect. Synchronizing on semantic provider events preserves the behavior under test and gives a precise failure when an expected transition never occurs; simply increasing the Awaitility timeout would retain the scheduler-dependent race and make the suite slower to diagnose.
Verification
ProviderTestsuccessfully in 10 fresh Gradle test executions.ProviderTestwith JDK 17.ProviderTestwith JDK 25, the newest locally available toolchain and closest proxy for the observed JDK 27 failure.feature-flagging-apitests.:products:feature-flagging:feature-flagging-api:spotlessCheck.