Repository navigation
Update the observerFail audio test for the engine observer rollback contract - #1240
Draft
hiroshihorie wants to merge 2 commits into
Draft
hiroshihorie wants to merge 2 commits into
hiroshihorie wants to merge 2 commits into
Conversation
LiveKitWebRTC 150.7871.08 made teardown hooks log-only. A failing did-stop, did-disable or will-release no longer fails the operation, so observerFail could no longer expect stopLocalRecording() to throw. The test now records every observer call and checks both sides of the contract in device and manual rendering modes. A failing teardown hook lets the stop succeed after every hook ran. A failing will-enable or will-start fails the start, rolls it back, and compensates the observer with did-disable and will-release as documented. The test also restores the shared AudioManager state it changes.
…rverfail-teardown-contract
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
LiveKitWebRTC 150.7871.08 (livekit/libwebrtc#312) changed what happens when an
AudioEngineObserverhook returns an error:observerFailstill expectedstopLocalRecording()to throw when did-stop failed. That is no longer the contract, so the test was out of date. It does not run in CI, so nothing caught it.What the test asserts now
TestEngineObserverrecords every call (hook and reported state) and can be told which hooks fail. In device rendering mode:stopLocalRecording()does not throw, the engine is stopped and not recording, and the hooks ran as did-stop, did-disable, will-release, with did-disable reporting playout and recording off.In manual rendering mode:
The test first requires a clean engine (not running, not in manual or always-prepared mode, nothing initialized), because the expected hook states depend on it. A
deferrestores the observers, rendering mode, voice processing policy and (on iOS) the session category, even if an expectation fails partway through.How it was tested
LiveKitAudioTests/AudioEngineObserverTestswith microphone access. 1 test in 1 suite, passed. It was run withxcrun xcteston the built test bundle, launched from Terminal. Underxcodebuild test-without-buildingthe test process did not get microphone access and stopped at the firststartLocalRecording()with "Microphone permission is not granted", before any contract assertion.build-for-testingonly, it compiles. Not run.--lint .and SwiftLint 0.65.1lint --strict: clean.Not run: no physical iOS device, no simulator run, no other
LiveKitAudioTestssuites. CI does not runLiveKitAudioTeststoday (theLiveKitCIscheme covers the Core, Nanopb and ObjC test targets), so CI only checks that this compiles.Test only, so no
.changesentry.