From 9b6fac90a501ff524f20822073c62545e7a05e11 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Fri, 20 Jan 2023 02:55:53 +0100 Subject: [PATCH] Reduce the number of concurrent testruns in cibuild --- test/TestBuildingBlocks/IntegrationTest.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/TestBuildingBlocks/IntegrationTest.cs b/test/TestBuildingBlocks/IntegrationTest.cs index 92f49879fc..69776e7b5d 100644 --- a/test/TestBuildingBlocks/IntegrationTest.cs +++ b/test/TestBuildingBlocks/IntegrationTest.cs @@ -12,10 +12,16 @@ namespace TestBuildingBlocks; /// public abstract class IntegrationTest : IAsyncLifetime { - private static readonly SemaphoreSlim ThrottleSemaphore = new(64); + private static readonly SemaphoreSlim ThrottleSemaphore; protected abstract JsonSerializerOptions SerializerOptions { get; } + static IntegrationTest() + { + int maxConcurrentTestRuns = Environment.GetEnvironmentVariable("APPVEYOR") != null ? 32 : 64; + ThrottleSemaphore = new SemaphoreSlim(maxConcurrentTestRuns); + } + public async Task<(HttpResponseMessage httpResponse, TResponseDocument responseDocument)> ExecuteHeadAsync(string requestUrl, Action? setRequestHeaders = null) {