Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TUnit.Engine/Events/EventReceiverRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private enum EventTypes
private volatile EventTypes _registeredEvents = EventTypes.None;
private readonly Dictionary<Type, object[]> _receiversByType = new();
private readonly ConcurrentDictionary<Type, Array> _cachedTypedReceivers = new();
private readonly object _lock = new();
private readonly Lock _lock = new();

/// <summary>
/// Register event receivers from a collection of objects
Expand Down
2 changes: 1 addition & 1 deletion TUnit.TestProject/AdaptiveParallelismTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class AdaptiveParallelismTests
{
private static int _currentlyRunning;
private static int _maxConcurrent;
private static readonly object _lock = new();
private static readonly Lock _lock = new();

[Test]
[Repeat(1000)]
Expand Down
2 changes: 1 addition & 1 deletion TUnit.TestProject/Bugs/4032/NestedAsyncInitializerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ await Assert.That(MockWebApplicationFactory.InitializeCount).IsEqualTo(1)
public static class DeepNestingInitializationTracker
{
private static readonly List<string> _initializationOrder = [];
private static readonly object _lock = new();
private static readonly Lock _lock = new();

public static void RecordInitialization(string name)
{
Expand Down
2 changes: 1 addition & 1 deletion TUnit.TestProject/CombinedDataSourceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public async Task WithTypedMethodDataSource(
#region Verification Tests - Ensure Correct Combinations

private static readonly HashSet<string> _seenCombinations = new();
private static readonly object _lock = new();
private static readonly Lock _lock = new();

[Test]
[CombinedDataSources]
Expand Down
8 changes: 4 additions & 4 deletions TUnit.TestProject/ParallelismValidationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class UnconstrainedParallelTests
private static readonly ConcurrentBag<(string TestName, DateTimeOffset Start, DateTimeOffset End)> _executionTimes = [];
private static int _concurrentCount = 0;
private static int _maxConcurrent = 0;
private static readonly object _lock = new();
private static readonly Lock _lock = new();

[After(Test)]
public async Task RecordExecution()
Expand Down Expand Up @@ -114,7 +114,7 @@ public class LimitedParallelTests
private static int _concurrentCount = 0;
private static int _maxConcurrent = 0;
private static int _exceededLimit = 0;
private static readonly object _lock = new();
private static readonly Lock _lock = new();

[After(Test)]
public async Task RecordExecution()
Expand Down Expand Up @@ -225,7 +225,7 @@ public class StrictlySerialTests
private static int _concurrentCount = 0;
private static int _maxConcurrent = 0;
private static int _exceededLimit = 0;
private static readonly object _lock = new();
private static readonly Lock _lock = new();

[After(Test)]
public async Task RecordExecution()
Expand Down Expand Up @@ -333,7 +333,7 @@ public class HighParallelismTests
private static readonly ConcurrentBag<(string TestName, DateTimeOffset Start, DateTimeOffset End)> _executionTimes = [];
private static int _concurrentCount = 0;
private static int _maxConcurrent = 0;
private static readonly object _lock = new();
private static readonly Lock _lock = new();

[After(Test)]
public async Task RecordExecution()
Expand Down
2 changes: 1 addition & 1 deletion TUnit.TestProject/ScopedEventReceiverTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace TUnit.TestProject;
[TestEndLogger(source: "assembly")]
public class ScopedEventReceiverTests
{
internal static readonly object _lock = new();
internal static readonly Lock _lock = new();
internal static readonly Dictionary<string, List<string>> _testStartEvents = new();
internal static readonly Dictionary<string, List<string>> _testEndEvents = new();

Expand Down
Loading