Commit a1edca2
fix(tests): tolerate scheduler drift in transition_engine start-time reads
CI run #142 (post-v0.3.15) failed Test (macos) on
`engine_stores_multiple_transitions`. Same class of flake fixed in #10
for `tui::app` animation tests: tests assert that `current()` returns
*exactly* `from` immediately after `start()`, but `current()` reads
`Instant::now() - started_at`, so any non-zero gap produces channel
drift through the OKLCH/RGB interpolation path. Linux measures sub-ms
gaps and rounds back to `from.srgb8()`; macOS-latest under load shows
5+ ms gaps and rounds to e.g. (254, 0, 0).
Three sibling tests share the pattern:
- transition_starts_at_from_color
- engine_stores_multiple_transitions
- engine_update_or_start_creates_if_missing
All three relaxed via a `assert_color_near` helper with ±5/255 channel
tolerance — large enough to absorb any plausible scheduler delay on a
100ms transition (5ms ≈ t=0.05, eased to ≈0.005, → ≈1.3/255 expected
delta — tolerance is 4× that).
`engine_stores_multiple_transitions` additionally adds an explicit
sentinel-default check first, so a missing-key regression now reports
"key not stored" instead of being conflated with start-color drift.
No production code change. Zero binary impact — v0.3.15 release is
unaffected; this only un-reds CI on main.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9fa5306 commit a1edca2
1 file changed
Lines changed: 38 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
222 | 247 | | |
223 | 248 | | |
224 | 249 | | |
225 | 250 | | |
226 | 251 | | |
227 | 252 | | |
228 | | - | |
229 | | - | |
| 253 | + | |
230 | 254 | | |
231 | 255 | | |
232 | 256 | | |
| |||
302 | 326 | | |
303 | 327 | | |
304 | 328 | | |
| 329 | + | |
| 330 | + | |
305 | 331 | | |
306 | 332 | | |
307 | 333 | | |
308 | 334 | | |
309 | | - | |
310 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
311 | 341 | | |
312 | 342 | | |
313 | 343 | | |
314 | 344 | | |
315 | 345 | | |
316 | 346 | | |
| 347 | + | |
317 | 348 | | |
318 | 349 | | |
319 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
320 | 353 | | |
321 | 354 | | |
322 | 355 | | |
| |||
0 commit comments