Skip to content

Handle native whisper failure codes#403

Merged
sandrohanea merged 2 commits into
mainfrom
codex/throw-exception-on-nativewhisper-error
Sep 5, 2025
Merged

Handle native whisper failure codes#403
sandrohanea merged 2 commits into
mainfrom
codex/throw-exception-on-nativewhisper-error

Improve error reporting and async cancellation

72c7650
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
GitHub Actions / Whisper.net Linux Test Results succeeded Jun 19, 2025 in 0s

162 passed, 0 failed and 2 skipped

Tests passed successfully

Report Passed Failed Skipped Time
tests/Whisper.net.Tests/TestResults/_pkrvmxyh4eaekms_2025-06-19_15_30_52.trx 81✅ 1⚪ 934s
tests/Whisper.net.Tests/TestResults/_pkrvmxyh4eaekms_2025-06-19_15_30_56.trx 81✅ 1⚪ 931s

✅ tests/Whisper.net.Tests/TestResults/_pkrvmxyh4eaekms_2025-06-19_15_30_52.trx

82 tests were completed in 934s with 81 passed, 0 failed and 1 skipped.

Test suite Passed Failed Skipped Time
Whisper.net.Tests.FactoryTests 6✅ 803ms
Whisper.net.Tests.ParallelTests 1✅ 201s
Whisper.net.Tests.ProcessAsyncFunctionalTests 5✅ 270s
Whisper.net.Tests.ProcessFunctionalTests 6✅ 1⚪ 405s
Whisper.net.Tests.ProcessingFailureTests 2✅ 23ms
Whisper.net.Tests.ProcessQuantizedTests 1✅ 71s
Whisper.net.Tests.SpeechToText.SpeechToTextOptionsExtensionsTests 44✅ 52ms
Whisper.net.Tests.SpeechToText.WhisperSpeechToTextClientConstructorTests 10✅ 256s
Whisper.net.Tests.SpeechToText.WhisperSpeechToTextClientTest 6✅ 400s

✅ Whisper.net.Tests.FactoryTests

✅ CreateBuilder_WithCorruptedModel_ShouldThrow
✅ CreateBuilder_WithDisposedFactory_ShouldThrow
✅ CreateBuilder_WithFileModel_ShouldReturnBuilder
✅ CreateBuilder_WithMemoryModel_ShouldReturnBuilder
✅ CreateBuilder_WithNoModel_ShouldThrow
✅ GetSupportedLanguages_ShouldReturnAll

✅ Whisper.net.Tests.ParallelTests

✅ ProcessAsync_ParallelExecution_WillCompleteEverytime

✅ Whisper.net.Tests.ProcessAsyncFunctionalTests

✅ ProcessAsync_CalledMultipleTimes_Serially_WillCompleteEverytime
✅ ProcessAsync_Cancelled_WillCancelTheProcessing_AndDispose_WillWaitUntilFullyFinished
✅ ProcessAsync_WhenJunkChunkExists_ProcessCorrectly
✅ ProcessAsync_WhenMultichannel_ProcessCorrectly
✅ TestHappyFlowAsync

✅ Whisper.net.Tests.ProcessFunctionalTests

✅ Process_CalledMultipleTimes_Serially_WillCompleteEverytime
✅ Process_WhenMultichannel_ProcessCorrectly
✅ Test_LibraryLoadError_ShouldFallbackToCPU(invalidLibrary: "cuda")
✅ Test_LibraryLoadError_ShouldFallbackToCPU(invalidLibrary: "openvino")
✅ TestAutoDetectLanguageWithRomanian
⚪ TestCancelEncoder
✅ TestHappyFlow

✅ Whisper.net.Tests.ProcessingFailureTests

✅ Process_WhenNativeFails_ShouldThrow
✅ ProcessAsync_WhenNativeFails_ShouldThrow

✅ Whisper.net.Tests.ProcessQuantizedTests

✅ TestHappyFlowQuantized

✅ Whisper.net.Tests.SpeechToText.SpeechToTextOptionsExtensionsTests

✅ WithAudioContextSize_SetsAdditionalProperty
✅ WithBeamSearchSamplingStrategy_SetsAdditionalProperty
✅ WithDuration_SetsAdditionalProperty
✅ WithEncoderBeginHandler_SetsAdditionalProperty
✅ WithEntropyThreshold_SetsAdditionalProperty
✅ WithGreedySamplingStrategy_SetsAdditionalProperty
✅ WithLanguage_SetsLanguageProperty
✅ WithLanguageDetection_SetsAdditionalProperty
✅ WithLanguageDetection_WithFalseParameter_SetsAdditionalPropertyToFalse
✅ WithLengthPenalty_SetsAdditionalProperty
✅ WithLogProbThreshold_SetsAdditionalProperty
✅ WithMaxInitialTs_SetsAdditionalProperty
✅ WithMaxLastTextTokens_SetsAdditionalProperty
✅ WithMaxSegmentLength_SetsAdditionalProperty
✅ WithMaxTokensPerSegment_SetsAdditionalProperty
✅ WithNoContext_SetsAdditionalProperty
✅ WithNoContext_WithFalseParameter_SetsAdditionalPropertyToFalse
✅ WithNoSpeechThreshold_SetsAdditionalProperty
✅ WithOffset_SetsAdditionalProperty
✅ WithOpenVinoEncoder_SetsAdditionalProperties
✅ WithOpenVinoEncoder_WithNullDeviceAndCache_SetsOnlyEncoderPath
✅ WithoutStringPool_SetsAdditionalProperty
✅ WithoutSuppressBlank_SetsAdditionalProperty
✅ WithPrintProgress_SetsAdditionalProperty
✅ WithPrintProgress_WithFalseParameter_SetsAdditionalPropertyToFalse
✅ WithPrintResults_SetsAdditionalProperty
✅ WithPrintResults_WithFalseParameter_SetsAdditionalPropertyToFalse
✅ WithPrintSpecialTokens_SetsAdditionalProperty
✅ WithPrintSpecialTokens_WithFalseParameter_SetsAdditionalPropertyToFalse
✅ WithPrintTimestamps_SetsAdditionalProperty
✅ WithPrintTimestamps_WithFalseParameter_SetsAdditionalPropertyToFalse
✅ WithProbabilities_SetsAdditionalProperty
✅ WithProbabilities_WithFalseParameter_SetsAdditionalPropertyToFalse
✅ WithProgressHandler_SetsAdditionalProperty
✅ WithSegmentEventHandler_SetsAdditionalProperty
✅ WithStringPool_SetsAdditionalProperty
✅ WithTemperature_SetsAdditionalProperty
✅ WithTemperatureInc_SetsAdditionalProperty
✅ WithThreads_SetsAdditionalProperty
✅ WithTokenTimestamps_SetsAdditionalProperty
✅ WithTokenTimestampsSumThreshold_SetsAdditionalProperty
✅ WithTokenTimestampsThreshold_SetsAdditionalProperty
✅ WithTranslate_SetsTextLanguageToEnglish
✅ WithWhisperLanguage_SetsAdditionalProperty

✅ Whisper.net.Tests.SpeechToText.WhisperSpeechToTextClientConstructorTests

✅ AfterDispose_GetStreamingTextAsync_ShouldThrowObjectDisposedException
✅ AfterDispose_GetTextAsync_ShouldThrowObjectDisposedException
✅ Constructor_WithFactoryBuilder_ShouldNotCreateFactoryImmediately
✅ Constructor_WithModelFileName_ShouldNotCreateFactoryImmediately
✅ Constructor_WithNullFactoryBuilder_ShouldThrowArgumentNullException
✅ Dispose_ShouldDisposeFactory
✅ FactoryBuilder_ReturningNull_ShouldThrowArgumentNullException
✅ GetStreamingTextAsync_ShouldCreateFactoryLazily
✅ GetTextAsync_ShouldCreateFactoryLazily
✅ MultipleRequests_ShouldReuseFactory

✅ Whisper.net.Tests.SpeechToText.WhisperSpeechToTextClientTest

✅ GetStreamingTextAsync_CalledMultipleTimes_Serially_WillCompleteEverytime
✅ GetTextAsync_CalledMultipleTimes_Serially_WillCompleteEverytime
✅ ProcessAsync_WhenJunkChunkExists_ProcessCorrectly
✅ ProcessAsync_WhenMultichannel_ProcessCorrectly
✅ TestHappyFlowAsync
✅ WithSegmentEventHandler_Cancelled_WillCancellTheProcessing_AndDispose

✅ tests/Whisper.net.Tests/TestResults/_pkrvmxyh4eaekms_2025-06-19_15_30_56.trx

82 tests were completed in 931s with 81 passed, 0 failed and 1 skipped.

Test suite Passed Failed Skipped Time
Whisper.net.Tests.FactoryTests 6✅ 337ms
Whisper.net.Tests.ParallelTests 1✅ 210s
Whisper.net.Tests.ProcessAsyncFunctionalTests 5✅ 284s
Whisper.net.Tests.ProcessFunctionalTests 6✅ 1⚪ 362s
Whisper.net.Tests.ProcessingFailureTests 2✅ 10ms
Whisper.net.Tests.ProcessQuantizedTests 1✅ 72s
Whisper.net.Tests.SpeechToText.SpeechToTextOptionsExtensionsTests 44✅ 30ms
Whisper.net.Tests.SpeechToText.WhisperSpeechToTextClientConstructorTests 10✅ 280s
Whisper.net.Tests.SpeechToText.WhisperSpeechToTextClientTest 6✅ 405s

✅ Whisper.net.Tests.FactoryTests

✅ CreateBuilder_WithCorruptedModel_ShouldThrow
✅ CreateBuilder_WithDisposedFactory_ShouldThrow
✅ CreateBuilder_WithFileModel_ShouldReturnBuilder
✅ CreateBuilder_WithMemoryModel_ShouldReturnBuilder
✅ CreateBuilder_WithNoModel_ShouldThrow
✅ GetSupportedLanguages_ShouldReturnAll

✅ Whisper.net.Tests.ParallelTests

✅ ProcessAsync_ParallelExecution_WillCompleteEverytime

✅ Whisper.net.Tests.ProcessAsyncFunctionalTests

✅ ProcessAsync_CalledMultipleTimes_Serially_WillCompleteEverytime
✅ ProcessAsync_Cancelled_WillCancelTheProcessing_AndDispose_WillWaitUntilFullyFinished
✅ ProcessAsync_WhenJunkChunkExists_ProcessCorrectly
✅ ProcessAsync_WhenMultichannel_ProcessCorrectly
✅ TestHappyFlowAsync

✅ Whisper.net.Tests.ProcessFunctionalTests

✅ Process_CalledMultipleTimes_Serially_WillCompleteEverytime
✅ Process_WhenMultichannel_ProcessCorrectly
✅ Test_LibraryLoadError_ShouldFallbackToCPU(invalidLibrary: "cuda")
✅ Test_LibraryLoadError_ShouldFallbackToCPU(invalidLibrary: "openvino")
✅ TestAutoDetectLanguageWithRomanian
⚪ TestCancelEncoder
✅ TestHappyFlow

✅ Whisper.net.Tests.ProcessingFailureTests

✅ Process_WhenNativeFails_ShouldThrow
✅ ProcessAsync_WhenNativeFails_ShouldThrow

✅ Whisper.net.Tests.ProcessQuantizedTests

✅ TestHappyFlowQuantized

✅ Whisper.net.Tests.SpeechToText.SpeechToTextOptionsExtensionsTests

✅ WithAudioContextSize_SetsAdditionalProperty
✅ WithBeamSearchSamplingStrategy_SetsAdditionalProperty
✅ WithDuration_SetsAdditionalProperty
✅ WithEncoderBeginHandler_SetsAdditionalProperty
✅ WithEntropyThreshold_SetsAdditionalProperty
✅ WithGreedySamplingStrategy_SetsAdditionalProperty
✅ WithLanguage_SetsLanguageProperty
✅ WithLanguageDetection_SetsAdditionalProperty
✅ WithLanguageDetection_WithFalseParameter_SetsAdditionalPropertyToFalse
✅ WithLengthPenalty_SetsAdditionalProperty
✅ WithLogProbThreshold_SetsAdditionalProperty
✅ WithMaxInitialTs_SetsAdditionalProperty
✅ WithMaxLastTextTokens_SetsAdditionalProperty
✅ WithMaxSegmentLength_SetsAdditionalProperty
✅ WithMaxTokensPerSegment_SetsAdditionalProperty
✅ WithNoContext_SetsAdditionalProperty
✅ WithNoContext_WithFalseParameter_SetsAdditionalPropertyToFalse
✅ WithNoSpeechThreshold_SetsAdditionalProperty
✅ WithOffset_SetsAdditionalProperty
✅ WithOpenVinoEncoder_SetsAdditionalProperties
✅ WithOpenVinoEncoder_WithNullDeviceAndCache_SetsOnlyEncoderPath
✅ WithoutStringPool_SetsAdditionalProperty
✅ WithoutSuppressBlank_SetsAdditionalProperty
✅ WithPrintProgress_SetsAdditionalProperty
✅ WithPrintProgress_WithFalseParameter_SetsAdditionalPropertyToFalse
✅ WithPrintResults_SetsAdditionalProperty
✅ WithPrintResults_WithFalseParameter_SetsAdditionalPropertyToFalse
✅ WithPrintSpecialTokens_SetsAdditionalProperty
✅ WithPrintSpecialTokens_WithFalseParameter_SetsAdditionalPropertyToFalse
✅ WithPrintTimestamps_SetsAdditionalProperty
✅ WithPrintTimestamps_WithFalseParameter_SetsAdditionalPropertyToFalse
✅ WithProbabilities_SetsAdditionalProperty
✅ WithProbabilities_WithFalseParameter_SetsAdditionalPropertyToFalse
✅ WithProgressHandler_SetsAdditionalProperty
✅ WithSegmentEventHandler_SetsAdditionalProperty
✅ WithStringPool_SetsAdditionalProperty
✅ WithTemperature_SetsAdditionalProperty
✅ WithTemperatureInc_SetsAdditionalProperty
✅ WithThreads_SetsAdditionalProperty
✅ WithTokenTimestamps_SetsAdditionalProperty
✅ WithTokenTimestampsSumThreshold_SetsAdditionalProperty
✅ WithTokenTimestampsThreshold_SetsAdditionalProperty
✅ WithTranslate_SetsTextLanguageToEnglish
✅ WithWhisperLanguage_SetsAdditionalProperty

✅ Whisper.net.Tests.SpeechToText.WhisperSpeechToTextClientConstructorTests

✅ AfterDispose_GetStreamingTextAsync_ShouldThrowObjectDisposedException
✅ AfterDispose_GetTextAsync_ShouldThrowObjectDisposedException
✅ Constructor_WithFactoryBuilder_ShouldNotCreateFactoryImmediately
✅ Constructor_WithModelFileName_ShouldNotCreateFactoryImmediately
✅ Constructor_WithNullFactoryBuilder_ShouldThrowArgumentNullException
✅ Dispose_ShouldDisposeFactory
✅ FactoryBuilder_ReturningNull_ShouldThrowArgumentNullException
✅ GetStreamingTextAsync_ShouldCreateFactoryLazily
✅ GetTextAsync_ShouldCreateFactoryLazily
✅ MultipleRequests_ShouldReuseFactory

✅ Whisper.net.Tests.SpeechToText.WhisperSpeechToTextClientTest

✅ GetStreamingTextAsync_CalledMultipleTimes_Serially_WillCompleteEverytime
✅ GetTextAsync_CalledMultipleTimes_Serially_WillCompleteEverytime
✅ ProcessAsync_WhenJunkChunkExists_ProcessCorrectly
✅ ProcessAsync_WhenMultichannel_ProcessCorrectly
✅ TestHappyFlowAsync
✅ WithSegmentEventHandler_Cancelled_WillCancellTheProcessing_AndDispose