Commit 51783a4
committed
test(integration): use page.clock for proactive token-refresh tests
The MemoryTokenCache cross-tab tests assumed JWT TTL = 60s and waited
50s of wall-clock time for the proactive refresh timer to fire. The
test instances now issue 300s tokens, so the timer is scheduled at
~283s (TTL - 15s leeway - 2s lead) and the 50s window never reaches
it — refreshRequests.length stays at 0 and the assertion fails.
Replace the wall-clock waits with `page.clock.install()` +
`clock.fastForward('5:00')` so the timer can be fired deterministically
regardless of the instance's actual TTL, and so tests no longer take
~50s of CI runtime each.
For the single-session test we sequence the fast-forwards (tab1 first,
then tab2 after the broadcast has had a chance to clear tab2's pending
timer) so we still exercise the BroadcastChannel-based dedup. For the
multi-session test we fast-forward both tabs in parallel because
different sessions have different tokenIds and don't dedupe.1 parent 4bbebcf commit 51783a4
2 files changed
Lines changed: 47 additions & 23 deletions
Lines changed: 16 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
251 | | - | |
252 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
253 | 257 | | |
254 | 258 | | |
255 | 259 | | |
| |||
265 | 269 | | |
266 | 270 | | |
267 | 271 | | |
| 272 | + | |
268 | 273 | | |
269 | 274 | | |
270 | 275 | | |
| |||
306 | 311 | | |
307 | 312 | | |
308 | 313 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
313 | 323 | | |
314 | 324 | | |
315 | | - | |
316 | 325 | | |
317 | 326 | | |
318 | 327 | | |
| |||
Lines changed: 31 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
141 | | - | |
142 | | - | |
143 | 142 | | |
144 | 143 | | |
145 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
146 | 153 | | |
147 | 154 | | |
148 | 155 | | |
| |||
167 | 174 | | |
168 | 175 | | |
169 | 176 | | |
170 | | - | |
171 | | - | |
| 177 | + | |
| 178 | + | |
172 | 179 | | |
173 | 180 | | |
174 | 181 | | |
175 | 182 | | |
176 | 183 | | |
177 | 184 | | |
178 | 185 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
186 | 201 | | |
187 | | - | |
188 | | - | |
| 202 | + | |
| 203 | + | |
189 | 204 | | |
190 | 205 | | |
191 | | - | |
| 206 | + | |
192 | 207 | | |
193 | 208 | | |
194 | 209 | | |
| |||
0 commit comments