From 796b4a06e7f095cb9f89d3eb7f29496627286b0d Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Fri, 6 Oct 2017 10:53:21 -0700 Subject: [PATCH] Use temporary path for fake deps.json in test --- .../GivenAProjectToolsCommandResolver.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs index aa25f2bd8..4b5a3874b 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs @@ -267,14 +267,8 @@ namespace Microsoft.DotNet.Tests var lockFile = new LockFileFormat().Read(lockFilePath); - var depsJsonFile = Path.Combine( - Path.GetDirectoryName(lockFilePath), - "dotnet-portable.deps.json"); - - if (File.Exists(depsJsonFile)) - { - File.Delete(depsJsonFile); - } + // NOTE: We must not use the real deps.json path here as it will interfere with tests running in parallel. + var depsJsonFile = Path.GetTempFileName(); File.WriteAllText(depsJsonFile, "temp"); var projectToolsCommandResolver = SetupProjectToolsCommandResolver();