Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not write lines to file Microsoft.NET.HostModel.ComHost.Tests #70969

Closed
jkotas opened this issue Jun 20, 2022 · 13 comments
Closed

Could not write lines to file Microsoft.NET.HostModel.ComHost.Tests #70969

jkotas opened this issue Jun 20, 2022 · 13 comments
Assignees
Labels
area-HostModel Microsoft.NET.HostModel issues blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab

Comments

@jkotas
Copy link
Member

jkotas commented Jun 20, 2022

Intermittent build error hit by Installer Build and Test coreclr windows_x64 Release in CI:

022-06-19T18:00:25.9981639Z   Running tests: D:\a\_work\1\s\artifacts\bin\AppHost.Bundle.Tests\Release\net7.0\AppHost.Bundle.Tests.dll [net7.0|x64]
2022-06-19T18:00:26.8040811Z   Running tests: D:\a\_work\1\s\artifacts\bin\Microsoft.NET.HostModel.AppHost.Tests\Release\net7.0\Microsoft.NET.HostModel.AppHost.Tests.dll [net7.0|x64]
2022-06-19T18:00:27.0021440Z   Running tests: D:\a\_work\1\s\artifacts\bin\Microsoft.NET.HostModel.ComHost.Tests\Release\net7.0\Microsoft.NET.HostModel.ComHost.Tests.dll [net7.0|x64]
2022-06-19T18:00:41.7216702Z   Tests succeeded: D:\a\_work\1\s\artifacts\bin\Microsoft.NET.HostModel.AppHost.Tests\Release\net7.0\Microsoft.NET.HostModel.AppHost.Tests.dll [net7.0|x64]
2022-06-19T18:01:10.6831061Z D:\a\_work\1\s\.packages\microsoft.dotnet.arcade.sdk\7.0.0-beta.22310.1\tools\VSTest.targets(55,5): error MSB3491: Could not write lines to file "D:\a\_work\1\s\artifacts\log\Release\Microsoft.NET.HostModel.ComHost.Tests_net7.0_x64.log". The process cannot access the file 'D:\a\_work\1\s\artifacts\log\Release\Microsoft.NET.HostModel.ComHost.Tests_net7.0_x64.log' because it is being used by another process. [D:\a\_work\1\s\src\installer\tests\Microsoft.NET.HostModel.Tests\Microsoft.NET.HostModel.ComHost.Tests\Microsoft.NET.HostModel.ComHost.Tests.csproj]
2022-06-19T18:01:10.7438162Z ##[error].packages\microsoft.dotnet.arcade.sdk\7.0.0-beta.22310.1\tools\VSTest.targets(55,5): error MSB3491: (NETCORE_ENGINEERING_TELEMETRY=Build) Could not write lines to file "D:\a\_work\1\s\artifacts\log\Release\Microsoft.NET.HostModel.ComHost.Tests_net7.0_x64.log". The process cannot access the file 'D:\a\_work\1\s\artifacts\log\Release\Microsoft.NET.HostModel.ComHost.Tests_net7.0_x64.log' because it is being used by another process.
2022-06-19T18:01:10.7456526Z   Running tests: D:\a\_work\1\s\artifacts\bin\Microsoft.NET.HostModel.Bundle.Tests\Release\net7.0\Microsoft.NET.HostModel.Bundle.Tests.dll [net7.0|x64]
2022-06-19T18:12:12.3099944Z   Tests succeeded: D:\a\_work\1\s\artifacts\bin\Microsoft.NET.HostModel.Bundle.Tests\Release\net7.0\Microsoft.NET.HostModel.Bundle.Tests.dll [net7.0|x64]
{
  "ErrorMessage": "error MSB3491: Could not write lines to file \"D:\\a\\_work\\1\\s\\artifacts\\log\\Release\\Microsoft.NET.HostModel.ComHost.Tests_net7.0_x64.log\"",
  "BuildRetry": false
}

Report

Build Definition Step Name Console log
1896046 dotnet/runtime Build Log
1894514 dotnet/runtime Build Log
1893340 dotnet/runtime Build Log
1891752 dotnet/runtime Build Log
1890865 dotnet/runtime Build Log
1886297 dotnet/runtime Build Log
1886561 dotnet/runtime Build Log
1886741 dotnet/runtime Build Log
1886981 dotnet/runtime Build Log
1892083 dotnet/runtime Build Log
1892899 dotnet/runtime Build Log
1892886 dotnet/runtime Build Log
1893235 dotnet/runtime Build Log
1893112 dotnet/runtime Build Log
1893373 dotnet/runtime Build Log
1894291 dotnet/runtime Build Log
1894338 dotnet/runtime Build Log
1894384 dotnet/runtime Build Log
1894521 dotnet/runtime Build Log
1894760 dotnet/runtime Build Log
1895037 dotnet/runtime Build Log
1895247 dotnet/runtime Build Log
1895305 dotnet/runtime Build Log
1896134 dotnet/runtime Build Log
1896006 dotnet/runtime Build Log
1896299 dotnet/runtime Build Log
1885715 dotnet/runtime Build Log
1884639 dotnet/runtime Build Log
1884836 dotnet/runtime Build Log

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 22 29
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-HostModel Microsoft.NET.HostModel issues label Jun 20, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jun 20, 2022
@ghost
Copy link

ghost commented Jun 20, 2022

Tagging subscribers to this area: @vitek-karas, @agocke
See info in area-owners.md if you want to be subscribed.

Issue Details

Intermittent build error hit by Installer Build and Test coreclr windows_x64 Release in CI:

022-06-19T18:00:25.9981639Z   Running tests: D:\a\_work\1\s\artifacts\bin\AppHost.Bundle.Tests\Release\net7.0\AppHost.Bundle.Tests.dll [net7.0|x64]
2022-06-19T18:00:26.8040811Z   Running tests: D:\a\_work\1\s\artifacts\bin\Microsoft.NET.HostModel.AppHost.Tests\Release\net7.0\Microsoft.NET.HostModel.AppHost.Tests.dll [net7.0|x64]
2022-06-19T18:00:27.0021440Z   Running tests: D:\a\_work\1\s\artifacts\bin\Microsoft.NET.HostModel.ComHost.Tests\Release\net7.0\Microsoft.NET.HostModel.ComHost.Tests.dll [net7.0|x64]
2022-06-19T18:00:41.7216702Z   Tests succeeded: D:\a\_work\1\s\artifacts\bin\Microsoft.NET.HostModel.AppHost.Tests\Release\net7.0\Microsoft.NET.HostModel.AppHost.Tests.dll [net7.0|x64]
2022-06-19T18:01:10.6831061Z D:\a\_work\1\s\.packages\microsoft.dotnet.arcade.sdk\7.0.0-beta.22310.1\tools\VSTest.targets(55,5): error MSB3491: Could not write lines to file "D:\a\_work\1\s\artifacts\log\Release\Microsoft.NET.HostModel.ComHost.Tests_net7.0_x64.log". The process cannot access the file 'D:\a\_work\1\s\artifacts\log\Release\Microsoft.NET.HostModel.ComHost.Tests_net7.0_x64.log' because it is being used by another process. [D:\a\_work\1\s\src\installer\tests\Microsoft.NET.HostModel.Tests\Microsoft.NET.HostModel.ComHost.Tests\Microsoft.NET.HostModel.ComHost.Tests.csproj]
2022-06-19T18:01:10.7438162Z ##[error].packages\microsoft.dotnet.arcade.sdk\7.0.0-beta.22310.1\tools\VSTest.targets(55,5): error MSB3491: (NETCORE_ENGINEERING_TELEMETRY=Build) Could not write lines to file "D:\a\_work\1\s\artifacts\log\Release\Microsoft.NET.HostModel.ComHost.Tests_net7.0_x64.log". The process cannot access the file 'D:\a\_work\1\s\artifacts\log\Release\Microsoft.NET.HostModel.ComHost.Tests_net7.0_x64.log' because it is being used by another process.
2022-06-19T18:01:10.7456526Z   Running tests: D:\a\_work\1\s\artifacts\bin\Microsoft.NET.HostModel.Bundle.Tests\Release\net7.0\Microsoft.NET.HostModel.Bundle.Tests.dll [net7.0|x64]
2022-06-19T18:12:12.3099944Z   Tests succeeded: D:\a\_work\1\s\artifacts\bin\Microsoft.NET.HostModel.Bundle.Tests\Release\net7.0\Microsoft.NET.HostModel.Bundle.Tests.dll [net7.0|x64]
Author: jkotas
Assignees: -
Labels:

area-HostModel, untriaged

Milestone: -

@jkotas
Copy link
Member Author

jkotas commented Jun 20, 2022

@jkotas
Copy link
Member Author

jkotas commented Jun 20, 2022

@jkotas jkotas added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Jun 20, 2022
@agocke
Copy link
Member

agocke commented Jun 20, 2022

@elinor-fung Could this be caused by recent changes?

@agocke agocke self-assigned this Jun 20, 2022
@elinor-fung
Copy link
Member

We did switch to the arcade infrastructure for using dotnet test (#69340).

We just rely on that infrastructure to redirect the output to a log file:
https://github.com/dotnet/arcade/blob/e7ede87875f41a9b3df898ae08da5ebc96e24f56/src/Microsoft.DotNet.Arcade.Sdk/tools/VSTest.targets#L30

And then append more information to the file after running the command (which is where it is failing):
https://github.com/dotnet/arcade/blob/e7ede87875f41a9b3df898ae08da5ebc96e24f56/src/Microsoft.DotNet.Arcade.Sdk/tools/VSTest.targets#L55

I'm not sure why the file would still be in use after the Exec finishes.

@elinor-fung
Copy link
Member

Related: dotnet/sdk#10062

It'd be good to figure out why it is happening, but maybe it could be mitigated by using ConsoleOutput to capture the output (instead of the > redirect) when running the test command and then writing all the lines in one shot.
https://github.com/dotnet/arcade/blob/e7ede87875f41a9b3df898ae08da5ebc96e24f56/src/Microsoft.DotNet.Arcade.Sdk/tools/VSTest.targets#L43-L50

@agocke
Copy link
Member

agocke commented Jun 22, 2022

I'm trying to take a look locally and see if we can find a solution

@danmoseley
Copy link
Member

danmoseley commented Jun 23, 2022

It'd be good to figure out why it is happening, but maybe it could be mitigated by using ConsoleOutput to capture the output (instead of the > redirect) when running the test command and then writing all the lines in one shot.

Another option perhaps is to write the command to the file first, then change the > to >> when subsequently writing the test output. Or, run Exec once, adding an extra line in the command that writes the output.

@agocke
Copy link
Member

agocke commented Jul 1, 2022

Since any change would likely have to be made in Arcade, I've filed dotnet/arcade#9864

@agocke agocke added the Known Build Error Use this to report build issues in the .NET Helix tab label Jul 15, 2022
@net-helix net-helix bot removed this from the 7.0.0 milestone Jul 15, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 15, 2022
@karelz
Copy link
Member

karelz commented Jul 22, 2022

dotnet/arcade#9864 has a fix, so waiting for it to propagate into runtime repo ...

@agocke agocke removed the untriaged New issue has not been triaged by the area owner label Jul 25, 2022
@agocke agocke added this to the 7.0.0 milestone Jul 25, 2022
@net-helix net-helix bot removed this from the 7.0.0 milestone Jul 25, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 25, 2022
@MattGal
Copy link
Member

MattGal commented Jul 25, 2022

dotnet/arcade#9864 has a fix, so waiting for it to propagate into runtime repo ...

Fix is propagated and I'm watching it; will port to other branches if it hasn't reproduced by tomorrow.

@agocke
Copy link
Member

agocke commented Jul 26, 2022

It looks like this is working well, no failures since Thursday.

@agocke agocke closed this as completed Jul 26, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jul 26, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-HostModel Microsoft.NET.HostModel issues blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab
Projects
Archived in project
Development

No branches or pull requests

7 participants