This repository was archived by the owner on Apr 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
test/dotnet-msbuild.Tests Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 77using System . Reflection ;
88using System . Runtime . InteropServices ;
99using FluentAssertions ;
10+ using Microsoft . DotNet . Cli ;
1011using Microsoft . DotNet . Configurer ;
1112using Microsoft . DotNet . Tools . MSBuild ;
1213using Microsoft . DotNet . Tools . Test . Utilities ;
1718using System . Diagnostics ;
1819using System . Threading ;
1920
21+ // There are tests which modify static Telemetry.CurrentSessionId and they cannot run in parallel
22+ [ assembly: CollectionBehavior ( DisableTestParallelization = true ) ]
23+
2024namespace Microsoft . DotNet . Cli . MSBuild . Tests
2125{
2226 public class GivenDotnetMSBuildBuildsProjects : TestBase
@@ -127,7 +131,7 @@ public void WhenTelemetryIsEnabledTheLoggerIsAddedToTheCommandLine()
127131 {
128132 Telemetry telemetry ;
129133 string [ ] allArgs = GetArgsForMSBuild ( ( ) => true , out telemetry ) ;
130- // telemetry will still be disabled if environmental variable is set
134+ // telemetry will still be disabled if environment variable is set
131135 if ( telemetry . Enabled )
132136 {
133137 allArgs . Should ( ) . NotBeNull ( ) ;
@@ -158,6 +162,7 @@ private string[] GetArgsForMSBuild(Func<bool> sentinelExists)
158162
159163 private string [ ] GetArgsForMSBuild ( Func < bool > sentinelExists , out Telemetry telemetry )
160164 {
165+ Telemetry . CurrentSessionId = null ; // reset static session id modified by telemetry constructor
161166 telemetry = new Telemetry ( new MockNuGetCacheSentinel ( sentinelExists ) ) ;
162167
163168 MSBuildForwardingApp msBuildForwardingApp = new MSBuildForwardingApp ( Enumerable . Empty < string > ( ) ) ;
You can’t perform that action at this time.
0 commit comments