Skip to content

Commit edc036b

Browse files
committed
Ensured stability of DB tests.
* Increased connection timeout when deleting or creating DB in DB tests (enables stable parallel execution of all DB tests including the transaction test). * Let all tests execute in one run again. No more separation of transaction DB test necessary.
1 parent 557049d commit edc036b

File tree

4 files changed

+2
-15
lines changed

4 files changed

+2
-15
lines changed

Build.ps1

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,7 @@ if ($SkipTests -eq $false) {
5454

5555
echo "build: Testing project in $test"
5656

57-
& dotnet test -c Release --filter "Category!=Isolated"
58-
if($LASTEXITCODE -ne 0) { exit 3 }
59-
60-
Pop-Location
61-
}
62-
63-
foreach ($test in ls test/*.Tests) {
64-
Push-Location $test
65-
66-
echo "build: Running isolated tests in $test"
67-
68-
& dotnet test -c Release --filter "Category=Isolated"
57+
& dotnet test -c Release
6958
if($LASTEXITCODE -ne 0) { exit 3 }
7059

7160
Pop-Location

test/Serilog.Sinks.MSSqlServer.Tests/TestUtils/DatabaseFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Serilog.Sinks.MSSqlServer.Tests.TestUtils
1313
public sealed class DatabaseFixture : IDisposable
1414
{
1515

16-
private const string _masterConnectionString = @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=Master;Integrated Security=True";
16+
private const string _masterConnectionString = @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=Master;Integrated Security=True;Connect Timeout=120";
1717
private const string _createLogEventsDatabase = @"
1818
EXEC ('CREATE DATABASE [{0}] ON PRIMARY
1919
(NAME = [{0}],

test/Serilog.Sinks.MSSqlServer.Tests/TestUtils/TestCategory.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ public static class TestCategory
55
public const string TraitName = "Category";
66

77
public const string Integration = nameof(Integration);
8-
public const string Isolated = nameof(Isolated);
98
public const string Unit = nameof(Unit);
109
}
1110
}

test/Serilog.Sinks.MSSqlServer.Tests/TransactionTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace Serilog.Sinks.MSSqlServer.Tests
88
{
9-
[Trait(TestCategory.TraitName, TestCategory.Isolated)]
109
public class TransactionTests : DatabaseTestsBase
1110
{
1211
public TransactionTests(ITestOutputHelper output) : base(output)

0 commit comments

Comments
 (0)