You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
audio-studio/android: cover the foreground-service lifecycle with an instrumented test #478
ForegroundServiceLifecycleTest guards the #474 fix with source assertions: a truth table over the extracted rules, plus checks that each call site is wired to them. That was mutation-tested against 20+ regression shapes and catches every one, but it has a structural limit the reviewer named plainly:
Source parsing cannot prevent every future weakening [...] A behavior-level instrumented test would be the stronger follow-up.
The specific loophole left open, judged not worth blocking the merge: narrowing if (ownedService) with && recordingConfig.keepAwake passes the containment-based guard assertions and could leak a notification-only service.
What an instrumented test would assert
Run on a device, and check the service rather than the source:
Record with the default config (keepAwake=true, showNotification=false), stop, assert no ServiceRecord remains
Same with showNotification=true
Record, stop, prepare a successor, assert no service is stranded
Record with both flags false, assert no service was started
All four are exactly what was verified by hand on a Pixel 6a for #477 via dumpsys activity services. Automating them replaces source-shape assertions with behavioural ones.
Blocked by
#475 — the instrumentation harness cannot run at all today for sherpa-onnx.rn. Whether audio-studio's androidTest suite runs is worth checking separately before this is picked up.
Activity