From 334ad7f55968a6a7570664c7cda1ceb87b7499b1 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Thu, 18 Apr 2024 14:16:10 -0700 Subject: [PATCH] Need to await for the semaphore to be effective --- .../Sdk/Frameworks/Runners/XunitTestAssemblyRunner.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/xunit.execution/Sdk/Frameworks/Runners/XunitTestAssemblyRunner.cs b/src/xunit.execution/Sdk/Frameworks/Runners/XunitTestAssemblyRunner.cs index 3ff8f1000..25dcb8421 100644 --- a/src/xunit.execution/Sdk/Frameworks/Runners/XunitTestAssemblyRunner.cs +++ b/src/xunit.execution/Sdk/Frameworks/Runners/XunitTestAssemblyRunner.cs @@ -265,14 +265,13 @@ protected override async Task RunTestCollectionsAsync(IMessageBus me } /// - protected override Task RunTestCollectionAsync(IMessageBus messageBus, ITestCollection testCollection, IEnumerable testCases, CancellationTokenSource cancellationTokenSource) + protected override async Task RunTestCollectionAsync(IMessageBus messageBus, ITestCollection testCollection, IEnumerable testCases, CancellationTokenSource cancellationTokenSource) { - parallelSemaphore?.Wait(); try { - return new XunitTestCollectionRunner(testCollection, testCases, DiagnosticMessageSink, messageBus, TestCaseOrderer, new ExceptionAggregator(Aggregator), cancellationTokenSource).RunAsync(); + return await new XunitTestCollectionRunner(testCollection, testCases, DiagnosticMessageSink, messageBus, TestCaseOrderer, new ExceptionAggregator(Aggregator), cancellationTokenSource).RunAsync(); } finally {