Commit 295d286
Fix flaky LifeCycleTest by improving test isolation
- Add @AfterEach to call OpenFeatureAPI.getInstance().shutdown(),
ensuring event handlers are cleared between tests. This prevents
handlers from one test leaking into another via the singleton.
- Remove incorrect assertion in canShutdownAnOfflineClient: the
offline LDClient does not transition its data source status to OFF
after close(). The test now verifies shutdown completes without error.
- Consolidate shutdown() calls: individual tests no longer need to
call OpenFeatureAPI.getInstance().shutdown() since @AfterEach
handles cleanup consistently.
Co-Authored-By: rlamb@launchdarkly.com <kingdewman@gmail.com>1 parent 10f9b8c commit 295d286
1 file changed
Lines changed: 6 additions & 10 deletions
Lines changed: 6 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
| |||
130 | 136 | | |
131 | 137 | | |
132 | 138 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| |||
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
169 | | - | |
170 | | - | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
192 | | - | |
193 | 191 | | |
194 | 192 | | |
195 | 193 | | |
| |||
222 | 220 | | |
223 | 221 | | |
224 | 222 | | |
225 | | - | |
226 | | - | |
227 | 223 | | |
228 | 224 | | |
0 commit comments