Skip to content

Commit 143003f

Browse files
committed
feat(tests): configure xunit parallelization and timeouts
1 parent 0b8e863 commit 143003f

13 files changed

Lines changed: 63 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ jobs:
5959
--coverage
6060
--coverage-output-format cobertura
6161
--results-directory ${{ env.TEST_OUTPUT_DIRECTORY }}
62+
--max-parallel-test-modules 2
6263
--solution *.slnx
6364
6465
- name: Report Code Coverage

src/Servus.Akka.TestKit.Tests/Servus.Akka.TestKit.Tests.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,10 @@
2121
<ProjectReference Include="..\Servus.Akka.TestKit\Servus.Akka.TestKit.csproj"/>
2222
</ItemGroup>
2323

24+
<ItemGroup>
25+
<Content Include="xunit.runner.json">
26+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
27+
</Content>
28+
</ItemGroup>
29+
2430
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
3+
"parallelizeTestCollections": true,
4+
"parallelizeAssembly": false,
5+
"maxParallelThreads": 2
6+
}

src/Servus.Akka.Tests/Servus.Akka.Tests.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@
2222
<ProjectReference Include="..\Servus.Akka\Servus.Akka.csproj"/>
2323
</ItemGroup>
2424

25+
<ItemGroup>
26+
<Content Include="xunit.runner.json">
27+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
28+
</Content>
29+
</ItemGroup>
30+
2531
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
3+
"parallelizeTestCollections": true,
4+
"parallelizeAssembly": false,
5+
"maxParallelThreads": 2
6+
}

src/TurboHTTP.AcceptanceTests/TurboHTTP.AcceptanceTests.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,10 @@
2121
<ProjectReference Include="..\TurboHTTP\TurboHTTP.csproj"/>
2222
</ItemGroup>
2323

24+
<ItemGroup>
25+
<Content Include="xunit.runner.json">
26+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
27+
</Content>
28+
</ItemGroup>
29+
2430
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
3+
"parallelizeTestCollections": true,
4+
"parallelizeAssembly": false,
5+
"maxParallelThreads": 2
6+
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
33
"parallelizeTestCollections": true,
4-
"parallelizeAssembly": false
4+
"parallelizeAssembly": false,
5+
"maxParallelThreads": 2
56
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
33
"parallelizeTestCollections": true,
4-
"parallelizeAssembly": false
4+
"parallelizeAssembly": false,
5+
"maxParallelThreads": 2
56
}

src/TurboHTTP.Tests/Client/NamedClientRuntimeSpec.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace TurboHTTP.Tests.Client;
77

88
public sealed class NamedClientRuntimeSpec
99
{
10-
[Fact(Timeout = 5000)]
10+
[Fact(Timeout = 15000)]
1111
public async Task CreateClient_same_name_should_reuse_single_named_runtime()
1212
{
1313
const string name = "shared-runtime";
@@ -33,7 +33,7 @@ public async Task CreateClient_same_name_should_reuse_single_named_runtime()
3333
}
3434
finally
3535
{
36-
await system.Terminate().WaitAsync(TimeSpan.FromSeconds(5), TestContext.Current.CancellationToken);
36+
await system.Terminate().WaitAsync(TimeSpan.FromSeconds(10), TestContext.Current.CancellationToken);
3737
}
3838
}
3939

@@ -75,11 +75,11 @@ public async Task CreateClient_concurrent_same_name_should_reuse_single_named_ru
7575
}
7676
finally
7777
{
78-
await system.Terminate().WaitAsync(TimeSpan.FromSeconds(5), TestContext.Current.CancellationToken);
78+
await system.Terminate().WaitAsync(TimeSpan.FromSeconds(10), TestContext.Current.CancellationToken);
7979
}
8080
}
8181

82-
[Fact(Timeout = 5000)]
82+
[Fact(Timeout = 15000)]
8383
public async Task CreateClient_different_names_should_not_share_named_runtime()
8484
{
8585
const string firstName = "runtime-a";
@@ -107,11 +107,11 @@ public async Task CreateClient_different_names_should_not_share_named_runtime()
107107
}
108108
finally
109109
{
110-
await system.Terminate().WaitAsync(TimeSpan.FromSeconds(5), TestContext.Current.CancellationToken);
110+
await system.Terminate().WaitAsync(TimeSpan.FromSeconds(10), TestContext.Current.CancellationToken);
111111
}
112112
}
113113

114-
[Fact(Timeout = 5000)]
114+
[Fact(Timeout = 15000)]
115115
public async Task CreateClient_shared_runtime_should_apply_named_base_address_defaults()
116116
{
117117
const string name = "named-defaults";
@@ -137,11 +137,11 @@ public async Task CreateClient_shared_runtime_should_apply_named_base_address_de
137137
}
138138
finally
139139
{
140-
await system.Terminate().WaitAsync(TimeSpan.FromSeconds(5), TestContext.Current.CancellationToken);
140+
await system.Terminate().WaitAsync(TimeSpan.FromSeconds(10), TestContext.Current.CancellationToken);
141141
}
142142
}
143143

144-
[Fact(Timeout = 5000)]
144+
[Fact(Timeout = 15000)]
145145
public async Task CreateClient_should_create_named_consumer_registration()
146146
{
147147
const string name = "registration-test";
@@ -164,7 +164,7 @@ public async Task CreateClient_should_create_named_consumer_registration()
164164
}
165165
finally
166166
{
167-
await system.Terminate().WaitAsync(TimeSpan.FromSeconds(5), TestContext.Current.CancellationToken);
167+
await system.Terminate().WaitAsync(TimeSpan.FromSeconds(10), TestContext.Current.CancellationToken);
168168
}
169169
}
170170

0 commit comments

Comments
 (0)