Skip to content

VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.

test(ios): dub job lock makes a second run or delete wait, so the in-use test no longer deadlocks

debpalash145832105ef5
diff --git a/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/PhoneWorkflowTests.swift b/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/PhoneWorkflowTests.swift
index 714659d4c..27c255d82 100644
--- a/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/PhoneWorkflowTests.swift
+++ b/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/PhoneWorkflowTests.swift
@@ -228,10 +228,15 @@ private struct FixtureMedia: PhoneDubMedia {
let pipeline = PhoneDubPipeline(store: store,engine: engine,decoder: FixtureDecoder(),media: FixtureMedia())
await #expect(throws: (any Error).self) { try await pipeline.run(id: request.id,models: Array(models.prefix(2))) }
#expect(await engine.transcriptions == 0)
+ // The per-job lock makes a second run or a delete wait for the holder instead of failing.
try await store.acquire(request.id)
- await #expect(throws: (any Error).self) { try await pipeline.run(id: request.id,models: models) }
- await #expect(throws: (any Error).self) { try await store.delete(request.id) }
+ let waitingRun = Task { try await pipeline.run(id: request.id,models: models) }
+ let waitingDelete = Task { try await store.delete(request.id) }
+ try await Task.sleep(nanoseconds: 100_000_000)
+ #expect(await engine.transcriptions == 0)
await store.release(request.id)
+ _ = try? await waitingRun.value
+ _ = try? await waitingDelete.value
await #expect(throws: (any Error).self) { try await store.file(request.id,"../outside") }
}
@Test(.enabled(if: ProcessInfo.processInfo.environment["VOICESTUDIO_REAL_AUX"] == "1"))