Fix probe tests and add timeouts

Former-commit-id: dc30010725
This commit is contained in:
Malte Rosenbjerg 2020-05-10 11:46:33 +02:00
parent 364406fa2a
commit d2852e7e56
3 changed files with 7 additions and 7 deletions

View file

@ -37,10 +37,10 @@ public void Probe_Success_FromStream()
{ {
var output = new FFProbe(); 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); 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(); 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(); var info = output.ParseVideoInfoAsync(stream).WaitForResult();
Assert.AreEqual(13, info.Duration.Seconds); Assert.AreEqual(10, info.Duration.Seconds);
} }
} }
} }

View file

@ -304,7 +304,7 @@ public void Video_ToMP4_Args_StreamPipe()
ConvertFromStreamPipe(VideoType.Mp4, container); ConvertFromStreamPipe(VideoType.Mp4, container);
} }
[TestMethod] [TestMethod, Timeout(45000)]
public void Video_ToMP4_Args_StreamOutputPipe_Async_Failure() public void Video_ToMP4_Args_StreamOutputPipe_Async_Failure()
{ {
Assert.ThrowsException<FFMpegException>(() => Assert.ThrowsException<FFMpegException>(() =>
@ -326,7 +326,7 @@ public void Video_ToMP4_Args_StreamOutputPipe_Async_Failure()
}); });
} }
[TestMethod] [TestMethod, Timeout(45000)]
public void Video_ToMP4_Args_StreamOutputPipe_Failure() public void Video_ToMP4_Args_StreamOutputPipe_Failure()
{ {
Assert.ThrowsException<FFMpegException>(() => Assert.ThrowsException<FFMpegException>(() =>

View file

@ -121,7 +121,7 @@ public async Task<VideoInfo> ParseVideoInfoAsync(System.IO.Stream stream)
var task = instance.FinishedRunning(); var task = instance.FinishedRunning();
try try
{ {
await pipeArgument.ProcessDataAsync().ConfigureAwait(false); await pipeArgument.ProcessDataAsync();
pipeArgument.ClosePipe(); pipeArgument.ClosePipe();
} }
catch (IOException) catch (IOException)