Commit 177ebe0
committed
test(flagd): withhold @reinitialization, and settle @Stale by evidence
Two declarations examined rather than asserted, one of which retracts a mistake.
@reinitialization is withheld, and no KnownDeviation accompanies it. shutdown()
sets the sync resources' isShutDown flag and never clears isInitialized
(FlagdProvider.java:136-155, FlagdProviderSyncResources.java:27-28, 112-115), so
a later initialize() returns at its first check without rebuilding the resolver,
the gRPC channel it shutdownNow()'d, the retry scheduler it terminated or the
final errorExecutor it tore down (FlagdProvider.java:121-125). A shut-down flagd
provider is terminally shut down.
That is permitted. Requirement 2.5.2 says a provider SHOULD revert to its
uninitialized state after shutdown, and its supporting text says "some providers
MAY allow reinitialization from this state". Reuse is an option, not an
obligation, and declining it is one of the choices the requirement offers. An
earlier version of this file recorded it as an untracked KnownDeviation against
@lifecycle, which was wrong twice over: the scenario was mandatory only because
the spec's assets had not yet gated it, and the entry asserted a defect against a
provider behaving inside the requirement. Withholding the tag is the whole of
what is owed; the one scenario it gates is now reported as skipped with that
reason instead of failing in RPC mode.
The lesson is more useful than the correction. Nothing had checked whether 2.5.2
requires reuse before the failure was written up as a defect -- the scenario
failed, so a deviation was recorded. Find the numbered requirement first. This is
the third rule in the suite found asserted more strongly than the spec states it.
@lifecycle stays declared. flagd reaches its backend during initialisation in
both modes, so the remaining lifecycle scenarios assert something real, and Java
declaring it is what made the cross-language divergence visible in the first
place -- Go and JavaScript withhold it and are being changed to match.
@Stale is declared for both resolvers and that is correct. PROVIDER_STALE is
emitted from FlagdProvider.onError (FlagdProvider.java:258-264), which the shared
onProviderEvent switch reaches on PROVIDER_ERROR from either resolver
(FlagdProvider.java:197, 236), so the emit is in the provider layer rather than a
transport -- and the scenario passes in RPC mode as well as in-process. Go's flagd
provider withholds the tag for RPC; on this evidence that is a difference between
the implementations, not a property of the transport.
Signed-off-by: Simon Schrottner <simon.schrottner@flagsmith.com>1 parent d83aea8 commit 177ebe0
1 file changed
Lines changed: 35 additions & 3 deletions
File tree
- providers/flagd/src/test/java/dev/openfeature/contrib/providers/flagd/e2e
Lines changed: 35 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
| |||
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
125 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
126 | 158 | | |
127 | 159 | | |
128 | 160 | | |
| |||
135 | 167 | | |
136 | 168 | | |
137 | 169 | | |
138 | | - | |
| 170 | + | |
139 | 171 | | |
140 | 172 | | |
141 | 173 | | |
| |||
0 commit comments