1212using Microsoft . DotNet . Tools . Dnup . Tests . Utilities ;
1313using Microsoft . Dotnet . Installation ;
1414using Xunit ;
15+ using Microsoft . Dotnet . Installation . Internal ;
1516
1617namespace Microsoft . DotNet . Tools . Dnup . Tests ;
1718
@@ -177,8 +178,8 @@ public async Task ConcurrentInstallsSerializeViaGlobalMutex()
177178 var args1 = DnupTestUtilities . BuildArguments ( channel , testEnv . InstallPath , testEnv . ManifestPath ) ;
178179 var args2 = DnupTestUtilities . BuildArguments ( channel , testEnv . InstallPath , testEnv . ManifestPath ) ;
179180
180- var installTask1 = Task . Run ( ( ) => DnupTestUtilities . RunDnupProcess ( args1 , captureOutput : true , workingDirectory : testEnv . TempRoot ) ) ;
181- var installTask2 = Task . Run ( ( ) => DnupTestUtilities . RunDnupProcess ( args2 , captureOutput : true , workingDirectory : testEnv . TempRoot ) ) ;
181+ var installTask1 = Task . Run ( ( ) => DnupTestUtilities . RunDnupProcess ( args1 , captureOutput : true , workingDirectory : testEnv . TempRoot ) ) ;
182+ var installTask2 = Task . Run ( ( ) => DnupTestUtilities . RunDnupProcess ( args2 , captureOutput : true , workingDirectory : testEnv . TempRoot ) ) ;
182183
183184 var results = await Task . WhenAll ( installTask1 , installTask2 ) ;
184185
@@ -187,13 +188,15 @@ public async Task ConcurrentInstallsSerializeViaGlobalMutex()
187188 results [ 1 ] . exitCode . Should ( ) . Be ( 0 ,
188189 $ "Second concurrent install failed with exit code { results [ 1 ] . exitCode } . Output:\n { results [ 1 ] . output } ") ;
189190
190- string manifestMutexName = DnupTestUtilities . GetManifestMutexName ( testEnv . ManifestPath ) ;
191- using ( var finalizeLock = new ScopedMutex ( manifestMutexName ) )
191+ var finalInstalls = new List < DotnetInstall > ( ) ;
192+
193+ using ( var finalizeLock = new ScopedMutex ( Constants . MutexNames . ModifyInstallationStates ) )
192194 {
193195 var manifest = new DnupSharedManifest ( testEnv . ManifestPath ) ;
194- var installs = manifest . GetInstalledVersions ( ) . Where ( i => DnupUtilities . PathsEqual ( i . InstallRoot . Path , testEnv . InstallPath ) ) . ToList ( ) ;
195- installs . Should ( ) . ContainSingle ( ) ;
196- installs [ 0 ] . Version . ToString ( ) . Should ( ) . Be ( channel ) ;
196+ finalInstalls = manifest . GetInstalledVersions ( ) . Where ( i => DnupUtilities . PathsEqual ( i . InstallRoot . Path , testEnv . InstallPath ) ) . ToList ( ) ;
197197 }
198+
199+ finalInstalls . Should ( ) . ContainSingle ( ) ;
200+ finalInstalls [ 0 ] . Version . ToString ( ) . Should ( ) . Be ( channel ) ;
198201 }
199202}
0 commit comments