From 18475cc86deb9d7839ffcb5706ace83d842a7eb6 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Sat, 5 May 2018 09:38:56 +0100 Subject: [PATCH] Use proper xunit single threading --- tests/SharpCompress.Test/TestBase.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/SharpCompress.Test/TestBase.cs b/tests/SharpCompress.Test/TestBase.cs index d8e5b587..6f6d314b 100644 --- a/tests/SharpCompress.Test/TestBase.cs +++ b/tests/SharpCompress.Test/TestBase.cs @@ -6,9 +6,11 @@ using System.Threading; using SharpCompress.Readers; using Xunit; +[assembly: CollectionBehavior(DisableTestParallelization = true)] + namespace SharpCompress.Test { - public class TestBase : IDisposable + public class TestBase { protected string SOLUTION_BASE_PATH = null; protected string TEST_ARCHIVES_PATH; @@ -270,12 +272,8 @@ namespace SharpCompress.Test return false; } - private static readonly object lockObject = new object(); - public TestBase() { - Monitor.Enter(lockObject); - var index = AppDomain.CurrentDomain.BaseDirectory.IndexOf("SharpCompress.Test", StringComparison.OrdinalIgnoreCase); SOLUTION_BASE_PATH = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory.Substring(0, index)); @@ -285,10 +283,5 @@ namespace SharpCompress.Test SCRATCH_FILES_PATH = Path.Combine(SOLUTION_BASE_PATH, "TestArchives", "Scratch"); SCRATCH2_FILES_PATH = Path.Combine(SOLUTION_BASE_PATH, "TestArchives", "Scratch2"); } - - public void Dispose() - { - Monitor.Exit(lockObject); - } } }