Repository navigation
test(siri): drive Spotlight cooldown and deferred-removal assertions with fakeAsync (#23380) - #23398
Conversation
|
Verdict: this is the right fix and correctly scoped - test-only determinism work with no production code touched and a proper changelog fragment.
USER IMPACT: none - internal change; users will notice no behavior difference, the test suite just stops flaking under concurrency. Nothing blocking. Optional nit: the "advance timers and the cooldown clock together" comment on the first converted test is helpful - the two session tests do the same double-duty AI-generated maintainer feedback on behalf of the Omi maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
aryanorastar
left a comment
There was a problem hiding this comment.
Reviewed f668040. No merge-blocking findings. The fakeAsync zone drives both production clock.now() and timer deadlines, removing the 80 ms wall-clock scheduling race while preserving the cooldown, deferred deletion, repair retry and account-fencing assertions. The production Spotlight source is byte-identical to current main; the changelog correctly declares no store-build behavior change.
Independent verification:
- All 28 tests pass on the exact PR head with --concurrency=2.
- A local prospective merge with current main 18c4a38 passed ten shuffled runs (seeds 23380–23389): 280 test executions passed.
- All 14 selected make preflight checks pass.
- Scratch-only negative controls confirm the key test fails if cooldown suppression is disabled or deferred-removal retries are suppressed. It still passes with a 250 ms real wall-clock stall before flushing queued work, exceeding the virtual 80 ms cooldown. All temporary changes and the prospective merge were restored; nothing from these controls is part of the PR.
- Exact-head Dart Analyze & Tests CI passed 7,121 tests, with four skipped; source Formatting/Hygiene and Mobile Release Eligibility pass. Latest metadata preflight passes. An older canceled metadata attempt is superseded by that successful metadata run, not counted as a source-code failure or a passing canceled job.
This resolves the test determinism issue #23380. It is not a production Spotlight behavior fix and needs no app/backend release or customer/device verification.
Fixes #23380
Summary
app/test/services/siri_integration_test.dart(includingdelete and newly locked memory submitted during cooldown reach Spotlight after cooldown) from wall-clockFuture<void>.delayed/drainIndexForTestwaits to deterministicfakeAsynctime progression.SiriIntegrationusesclock.now()andTimerfor native call timeouts, index cooldown windows, and deferred-removal retry flushes, driving both the timeout/cooldown clock and retry timers viaFakeAsyncprevents scheduler pressure in full-suite runs (flutter test --concurrency=2) from expiring the 80 ms cooldown before intermediate call-count assertions execute.Product invariants affected
Failure Mode & Blast Radius
app/test/services/siri_integration_test.dart. No production code paths are modified.UI-Evidence: none — test-only change with no visual UI surface changes.
Failure-Class: none