Skip to content

Commit 5d0755d

Browse files
committed
test: wire FDv1 Fallback Directive into contract test service
Declare the fdv1-fallback capability and accept the new top-level dataSystem.fdv1Fallback config object, wiring it directly to the SDK's FDv1 Fallback Synchronizer. Drop the heuristic that previously inferred the FDv1 fallback from the last polling synchronizer entry -- the FDv1 Fallback Synchronizer is a distinct configuration concern from the FDv2 Primary/Fallback chain. Also bump the test harness pin to v3.0.0-alpha.6 so the new fdv1-fallback test suite runs in CI.
1 parent 0640b72 commit 5d0755d

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
with:
7070
test_service_port: 9000
7171
token: ${{ secrets.GITHUB_TOKEN }}
72-
version: v3.0.0-alpha.4
72+
version: v3.0.0-alpha.6
7373
enable_persistence_tests: "true"
7474

7575
windows:

contract-tests/client_entity.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def __init__(self, tag, config):
6262
sync_configs = datasystem_config.get('synchronizers')
6363
if sync_configs is not None:
6464
sync_builders = []
65-
fallback_builder = None
6665

6766
for sync_config in sync_configs:
6867
streaming = sync_config.get('streaming')
@@ -79,14 +78,18 @@ def __init__(self, tag, config):
7978
_set_optional_time(polling, "pollIntervalMs", builder.poll_interval)
8079
sync_builders.append(builder)
8180

82-
fallback_builder = fdv1_fallback_ds_builder()
83-
_set_optional_value(polling, "baseUri", fallback_builder.base_uri)
84-
_set_optional_time(polling, "pollIntervalMs", fallback_builder.poll_interval)
85-
8681
if sync_builders:
8782
datasystem.synchronizers(*sync_builders)
88-
if fallback_builder is not None:
89-
datasystem.fdv1_compatible_synchronizer(fallback_builder)
83+
84+
# The FDv1 Fallback Synchronizer is engaged only in response to a
85+
# server-directed FDv1 Fallback Directive; it is configured separately
86+
# from the FDv2 Primary/Fallback synchronizer chain.
87+
fdv1_fallback_config = datasystem_config.get('fdv1Fallback')
88+
if fdv1_fallback_config is not None:
89+
fallback_builder = fdv1_fallback_ds_builder()
90+
_set_optional_value(fdv1_fallback_config, "baseUri", fallback_builder.base_uri)
91+
_set_optional_time(fdv1_fallback_config, "pollIntervalMs", fallback_builder.poll_interval)
92+
datasystem.fdv1_compatible_synchronizer(fallback_builder)
9093

9194
if datasystem_config.get("payloadFilter") is not None:
9295
opts["payload_filter_key"] = datasystem_config["payloadFilter"]

contract-tests/service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def status():
8484
'persistent-data-store-consul',
8585
'flag-change-listeners',
8686
'flag-value-change-listeners',
87+
'fdv1-fallback',
8788
]
8889
}
8990
return json.dumps(body), 200, {'Content-type': 'application/json'}

0 commit comments

Comments
 (0)