Skip to content

Commit 09a1d25

Browse files
committed
Replace dotnet run with dotnet exec to bypass SDK argument parsing regression
dotnet run in SDK 10.0.300 incorrectly forwards its own options (--verbosity, --configuration, --no-build) as application arguments on the CI agent (Ubuntu 22.04). This cannot be reproduced locally with the same SDK version but manifests consistently on hosted agents. Since we build separately anyway (--no-build), switch to dotnet exec which directly invokes the built DLL without any argument parsing ambiguity.
1 parent 315f878 commit 09a1d25

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

eng/pipelines/stress/stress-tests-job.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,9 @@ jobs:
112112
--verbosity ${{ parameters.dotnetVerbosity }}
113113
-p:Configuration=${{ parameters.buildConfiguration }}
114114
115-
# dotnet CLI arguments for run.
116-
- name: runArguments
117-
value: >-
118-
--verbosity ${{ parameters.dotnetVerbosity }}
119-
--configuration ${{ parameters.buildConfiguration }}
120-
--no-build
115+
# The output directory where the built stress test binaries are placed.
116+
- name: outputDir
117+
value: $(Build.SourcesDirectory)/src/Microsoft.Data.SqlClient/tests/StressTests/SqlClient.Stress.Runner/bin/${{ parameters.buildConfiguration }}
121118

122119
# The contents of the config file to use for all tests. We will write this to a JSON file and
123120
# then point to it via the STRESS_CONFIG_FILE environment variable.
@@ -188,6 +185,11 @@ jobs:
188185

189186
# Run the stress tests for each .NET runtime.
190187
#
188+
# We use `dotnet exec` instead of `dotnet run` because SDK 10.0.300 has a regression where
189+
# `dotnet run` forwards its own options (--verbosity, --configuration, --no-build) as
190+
# application arguments on hosted Ubuntu agents. Since we build separately above, `dotnet
191+
# exec` is both simpler and immune to argument-parsing changes in the SDK.
192+
#
191193
# The condition and continueOnError work together to achieve the following behavior:
192194
#
193195
# condition: and(succeededOrFailed(), eq(variables['buildSucceeded'], 'true'))
@@ -211,8 +213,8 @@ jobs:
211213
STRESS_CONFIG_FILE: config.json
212214
inputs:
213215
command: custom
214-
custom: run
215-
arguments: --project $(project) $(runArguments) -f ${{ runtime }} -- $(testArguments)
216+
custom: exec
217+
arguments: $(outputDir)/${{ runtime }}/stresstest.dll $(testArguments)
216218

217219
# Run the stress tests for each .NET Framework runtime.
218220
- ${{ each runtime in parameters.netFrameworkTestRuntimes }}:
@@ -224,5 +226,5 @@ jobs:
224226
STRESS_CONFIG_FILE: config.json
225227
inputs:
226228
command: custom
227-
custom: run
228-
arguments: --project $(project) $(runArguments) -f ${{ runtime }} -- $(testArguments)
229+
custom: exec
230+
arguments: $(outputDir)/${{ runtime }}/stresstest.dll $(testArguments)

0 commit comments

Comments
 (0)