From 22612593ea1f29410cf4ffc485559e97f8c7b3e1 Mon Sep 17 00:00:00 2001 From: jsonbailey Date: Fri, 2 Oct 2026 10:24:11 -0500 Subject: [PATCH 1/2] chore: Wait for the replacement flag in the FDv1 fallback spec The spec released its wait once two flag change events had arrived, then asserted that the collected keys included the FDv1 replacement flag. Applying the FDv1 payload replaces the initializer's data, so it reports the removed flag as well as the added one. The full sequence is always initialflag, initialflag, fdv1replacementflag, which means the count of two was reached before the awaited flag arrived, every run on every platform. The assertion passed only because the third event usually landed in the window between the wait returning and the keys being read. JRuby's real parallelism loses that race often enough to fail CI. The wait now keys on the replacement flag itself. The collection is a Concurrent::Array because the data source thread appends to it while the spec thread reads it. --- spec/impl/data_system/fdv2_datasystem_spec.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/impl/data_system/fdv2_datasystem_spec.rb b/spec/impl/data_system/fdv2_datasystem_spec.rb index 0f2759bc..2fd3653a 100644 --- a/spec/impl/data_system/fdv2_datasystem_spec.rb +++ b/spec/impl/data_system/fdv2_datasystem_spec.rb @@ -441,12 +441,15 @@ def with_data_system(initializers, synchronizers) .build changed = Concurrent::Event.new - changes = [] + changes = Concurrent::Array.new listener = Object.new listener.define_singleton_method(:update) do |flag_change| changes << flag_change - changed.set if changes.length >= 2 + # The FDv1 payload replaces the initializer's data, so it reports + # the removed flag as well as the added one. Wait for the added + # flag itself; a count can be reached before it arrives. + changed.set if flag_change.key == "fdv1replacementflag" end fdv2 = FDv2.new(sdk_key, config, data_system_config) From 560eb1bd57f0486d9e2330c73a157b47bfe2d857 Mon Sep 17 00:00:00 2001 From: jsonbailey Date: Mon, 5 Oct 2026 08:58:50 -0500 Subject: [PATCH 2/2] chore: Drop the comment restating the gate condition --- spec/impl/data_system/fdv2_datasystem_spec.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/spec/impl/data_system/fdv2_datasystem_spec.rb b/spec/impl/data_system/fdv2_datasystem_spec.rb index 2fd3653a..d1654ba4 100644 --- a/spec/impl/data_system/fdv2_datasystem_spec.rb +++ b/spec/impl/data_system/fdv2_datasystem_spec.rb @@ -446,9 +446,6 @@ def with_data_system(initializers, synchronizers) listener = Object.new listener.define_singleton_method(:update) do |flag_change| changes << flag_change - # The FDv1 payload replaces the initializer's data, so it reports - # the removed flag as well as the added one. Wait for the added - # flag itself; a count can be reached before it arrives. changed.set if flag_change.key == "fdv1replacementflag" end