@@ -20,6 +20,7 @@ internal partial class TestingPlatformCommand : CliCommand, ICustomHelp
2020 private MSBuildConnectionHandler _msBuildConnectionHandler ;
2121 private TestModulesFilterHandler _testModulesFilterHandler ;
2222 private TerminalTestReporter _output ;
23+ private bool _isHelp ;
2324 private TestApplicationActionQueue _actionQueue ;
2425 private Task _namedPipeConnectionLoop ;
2526 private List < string > _args ;
@@ -77,10 +78,11 @@ public int Run(ParseResult parseResult)
7778 ShowAssemblyStartAndComplete = true ,
7879 } ) ;
7980 _output = output ;
80- _output . TestExecutionStarted ( DateTimeOffset . Now , degreeOfParallelism , _isDiscovery ) ;
8181
82+ _isHelp = false ;
8283 if ( ContainsHelpOption ( parseResult . GetArguments ( ) ) )
8384 {
85+ _isHelp = true ;
8486 _actionQueue = new ( degreeOfParallelism , async ( TestApplication testApp ) =>
8587 {
8688 testApp . HelpRequested += OnHelpRequested ;
@@ -90,12 +92,13 @@ public int Run(ParseResult parseResult)
9092 testApp . ExecutionIdReceived += OnExecutionIdReceived ;
9193
9294 var result = await testApp . RunAsync ( filterModeEnabled , enableHelp : true , builtInOptions ) ;
93- CompleteRun ( ) ;
9495 return result ;
9596 } ) ;
9697 }
9798 else
9899 {
100+ _output . TestExecutionStarted ( DateTimeOffset . Now , degreeOfParallelism , _isDiscovery ) ;
101+
99102 _actionQueue = new ( degreeOfParallelism , async ( TestApplication testApp ) =>
100103 {
101104 testApp . HandshakeReceived += OnHandshakeReceived ;
@@ -165,7 +168,10 @@ private void CompleteRun()
165168 {
166169 if ( Interlocked . CompareExchange ( ref _cancelled , 1 , 0 ) == 0 )
167170 {
168- _output ? . TestExecutionCompleted ( DateTimeOffset . Now ) ;
171+ if ( ! _isHelp )
172+ {
173+ _output ? . TestExecutionCompleted ( DateTimeOffset . Now ) ;
174+ }
169175 }
170176 }
171177
0 commit comments