From d2852e7e568fae00cbf89f9501dbc118b7799ee7 Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Sun, 10 May 2020 11:46:33 +0200 Subject: [PATCH] Fix probe tests and add timeouts Former-commit-id: dc30010725deb94f98819182089e865d36aaa9b0 --- FFMpegCore.Test/FFProbeTests.cs | 8 ++++---- FFMpegCore.Test/VideoTest.cs | 4 ++-- FFMpegCore/FFMPEG/FFProbe.cs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/FFMpegCore.Test/FFProbeTests.cs b/FFMpegCore.Test/FFProbeTests.cs index 5e877ff..e9b01aa 100644 --- a/FFMpegCore.Test/FFProbeTests.cs +++ b/FFMpegCore.Test/FFProbeTests.cs @@ -37,10 +37,10 @@ public void Probe_Success_FromStream() { var output = new FFProbe(); - using (var stream = File.OpenRead(VideoLibrary.LocalVideo.FullName)) + using (var stream = File.OpenRead(VideoLibrary.LocalVideoWebm.FullName)) { var info = output.ParseVideoInfo(stream); - Assert.AreEqual(13, info.Duration.Seconds); + Assert.AreEqual(10, info.Duration.Seconds); } } @@ -49,11 +49,11 @@ public void Probe_Success_FromStream_Async() { var output = new FFProbe(); - using (var stream = File.OpenRead(VideoLibrary.LocalVideo.FullName)) + using (var stream = File.OpenRead(VideoLibrary.LocalVideoWebm.FullName)) { var info = output.ParseVideoInfoAsync(stream).WaitForResult(); - Assert.AreEqual(13, info.Duration.Seconds); + Assert.AreEqual(10, info.Duration.Seconds); } } } diff --git a/FFMpegCore.Test/VideoTest.cs b/FFMpegCore.Test/VideoTest.cs index 0f4fc7f..22bdfb6 100644 --- a/FFMpegCore.Test/VideoTest.cs +++ b/FFMpegCore.Test/VideoTest.cs @@ -304,7 +304,7 @@ public void Video_ToMP4_Args_StreamPipe() ConvertFromStreamPipe(VideoType.Mp4, container); } - [TestMethod] + [TestMethod, Timeout(45000)] public void Video_ToMP4_Args_StreamOutputPipe_Async_Failure() { Assert.ThrowsException(() => @@ -326,7 +326,7 @@ public void Video_ToMP4_Args_StreamOutputPipe_Async_Failure() }); } - [TestMethod] + [TestMethod, Timeout(45000)] public void Video_ToMP4_Args_StreamOutputPipe_Failure() { Assert.ThrowsException(() => diff --git a/FFMpegCore/FFMPEG/FFProbe.cs b/FFMpegCore/FFMPEG/FFProbe.cs index 5f54303..d73a8f5 100644 --- a/FFMpegCore/FFMPEG/FFProbe.cs +++ b/FFMpegCore/FFMPEG/FFProbe.cs @@ -121,7 +121,7 @@ public async Task ParseVideoInfoAsync(System.IO.Stream stream) var task = instance.FinishedRunning(); try { - await pipeArgument.ProcessDataAsync().ConfigureAwait(false); + await pipeArgument.ProcessDataAsync(); pipeArgument.ClosePipe(); } catch (IOException)