Skip to content

Commit b5da17b

Browse files
authored
[tests] Fixes to improve helix test runs hitting docker soft limits for network subnets (#5694)
* [tests] Disable parallel test runs on helix This would help with too many docker network subnets being allocated in parallel, and thus hitting soft limits on the helix agents. * [tests] Prune docker networks on helix agents before/after the runs * [tests] Bump timeout for Aspire.Pomelo.EntityFrameworkCore.MySql.Tests to 20mins * Address review feedback from @ joperezr * fix typo
1 parent f7f5645 commit b5da17b

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

tests/Directory.Build.targets

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<VSTestRunSettingsFile Condition="'$(VSTestRunSettingsFile)' == ''">$(RunSettingsFilePath)</VSTestRunSettingsFile>
99

1010
<DeployRunSettingsFile Condition="'$(DeployRunSettingsFile)' == ''">true</DeployRunSettingsFile>
11+
<!-- Use a separate xunit.runner.json for helix that disables parallel test runs -->
12+
<XunitRunnerJson Condition="'$(XunitRunnerJson)' == '' and '$(ArchiveTests)' == 'true'">$(RepoRoot)tests\helix\xunit.runner.json</XunitRunnerJson>
1113
<XunitRunnerJson Condition="'$(XunitRunnerJson)' == ''">$(RepositoryEngineeringDir)testing\xunit.runner.json</XunitRunnerJson>
1214

1315
<RunTestsOnHelix Condition="'$(RunTestsOnHelix)' == '' and ('$(IsTestProject)' == 'true' and '$(IsTestSupportProject)' != 'true')">true</RunTestsOnHelix>

tests/helix/send-to-helix-basictests.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@
2929

3030
<ItemGroup>
3131
<_DefaultWorkItems Include="$(WorkItemArchiveWildCard)" />
32-
<!-- runsettings timeout in ms, default to 10 mins -->
32+
<!-- runsettings timeout in ms, default to 15 mins -->
3333
<_DefaultWorkItems TimeoutMs="900000" />
3434

3535
<_DefaultWorkItems Condition="'%(FileName)' == 'Aspire.Hosting.Elasticsearch.Tests'" TimeoutMs="1200000" />
3636
<_DefaultWorkItems Condition="'%(FileName)' == 'Aspire.Hosting.Oracle.Tests'" TimeoutMs="1200000" />
37+
<_DefaultWorkItems Condition="'%(FileName)' == 'Aspire.Pomelo.EntityFrameworkCore.MySql.Tests'" TimeoutMs="1200000" />
3738

3839
<HelixWorkItem Include="@(_DefaultWorkItems -> '%(FileName)')">
3940
<PayloadArchive>%(Identity)</PayloadArchive>

tests/helix/send-to-helix-inner.proj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@
126126
<HelixPreCommand Include="$(_ShutdownDockerContainersCommand)" />
127127
<HelixPreCommand Include="docker volume ls" />
128128
<HelixPreCommand Include="$(_DeleteDockerVolumesCommand)" />
129+
<HelixPreCommand Include="docker network prune -f" />
129130

130131
<HelixPostCommand Include="docker container ls --all" />
131132
<HelixPostCommand Include="$(_ShutdownDockerContainersCommand)" />
132133
<HelixPostCommand Include="docker volume ls" />
133134
<HelixPostCommand Include="$(_DeleteDockerVolumesCommand)" />
135+
<HelixPostCommand Include="docker network prune -f" />
134136
</ItemGroup>
135137

136138
<ItemGroup>

tests/helix/xunit.runner.json

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+
"longRunningTestSeconds": 120,
4+
"parallelizeAssembly": false,
5+
"parallelizeTestCollections": false
6+
}

0 commit comments

Comments
 (0)