Skip to content

Commit c7e396d

Browse files
authored
Merge pull request #1247 from json-api-dotnet/tests-throttle
Reduce the number of concurrent testruns in cibuild
2 parents be99234 + 9b6fac9 commit c7e396d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/TestBuildingBlocks/IntegrationTest.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ namespace TestBuildingBlocks;
1212
/// </summary>
1313
public abstract class IntegrationTest : IAsyncLifetime
1414
{
15-
private static readonly SemaphoreSlim ThrottleSemaphore = new(64);
15+
private static readonly SemaphoreSlim ThrottleSemaphore;
1616

1717
protected abstract JsonSerializerOptions SerializerOptions { get; }
1818

19+
static IntegrationTest()
20+
{
21+
int maxConcurrentTestRuns = Environment.GetEnvironmentVariable("APPVEYOR") != null ? 32 : 64;
22+
ThrottleSemaphore = new SemaphoreSlim(maxConcurrentTestRuns);
23+
}
24+
1925
public async Task<(HttpResponseMessage httpResponse, TResponseDocument responseDocument)> ExecuteHeadAsync<TResponseDocument>(string requestUrl,
2026
Action<HttpRequestHeaders>? setRequestHeaders = null)
2127
{

0 commit comments

Comments
 (0)