Skip to content

Commit

Permalink
Attempt to make fragile tests less demanding for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
atruskie committed Aug 17, 2020
1 parent 7fb64df commit 5143bdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ namespace Acoustics.Test.AnalysisPrograms.AnalyzeLongRecordings
/// (5) Wherever possible, don't use test assets.
/// </summary>
[TestClass]
[DoNotParallelize]
public class TestAnalyzeLongRecording
{
private DirectoryInfo outputDirectory;
Expand All @@ -52,7 +53,7 @@ public void Cleanup()
/// Acoustic indices as calculated from Linear frequency scale spectrogram.
/// </summary>
[TestMethod]
[Timeout(240_000)]
[Timeout(300_000)]
public void TestAnalyzeSr22050Recording()
{
int sampleRate = 22050;
Expand Down
7 changes: 4 additions & 3 deletions tests/Acoustics.Test/Shared/ProcessRunnerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ namespace Acoustics.Test.Shared
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
[DoNotParallelize]
public class ProcessRunnerTests : OutputDirectoryTest
{
public const string TestFile = "very_large_file_20170522-180007Z.flac";

[RetryTestMethod(2)]
[RetryTestMethod(3)]
public void ProcessRunnerDoesNotDeadlock()
{
var result = Enumerable.Range(0, 100).AsParallel().Select(this.RunFfprobe).ToArray();
var result = Enumerable.Range(0, 50).AsParallel().Select(this.RunFfprobe).ToArray();

Assert.IsTrue(result.All());
}
Expand All @@ -33,7 +34,7 @@ public void ProcessRunnerSimple()
[RetryTestMethod(2)]
public void ProcessRunnerTimeOutDoesNotDeadlock()
{
var result = Enumerable.Range(0, 100).AsParallel().Select(this.RunFfmpegIndefinite).ToArray();
var result = Enumerable.Range(0, 50).AsParallel().Select(this.RunFfmpegIndefinite).ToArray();

Assert.IsTrue(result.All());
}
Expand Down

0 comments on commit 5143bdc

Please sign in to comment.