runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Build race conditions in priority 2 tests

Open RussKeldorph opened this issue 10 years ago • 7 comments

There seems to be a race condition when building "priority 2" tests. I've only seen them in two folders

tests\src\baseservices\threading\interlocked
tests\src\baseservices\threading\paramthreadstart

It may have something to do with the pattern of referencing BuildOnly projects from RunOnly projects, as those folders contain the vast majority of the examples in the tree; the only other example being

tests\src\Loader\classloader\nesting\coreclr\VSW491577*.csproj.

Below are samples of the errors I've seen:

CSC : error CS2012: Cannot open 'C:\git\coreclr\bin\tests\obj\baseservices\threading\interlocked\add\InterlockedAddInt\InterlockedAddInt.exe' for writing -- 'The process cannot access the file 'C:\git\coreclr\bin\tests\obj\baseservices\threading\interlocked\add\InterlockedAddInt\InterlockedAddInt.exe' because it is being used by another process.' [C:\git\coreclr\tests\src\baseservices\threading\interlocked\add\InterlockedAddInt.csproj]
CSC : error CS2012: Cannot open 'C:\git\coreclr\bin\tests\obj\baseservices\threading\paramthreadstart\ThreadStartByte\ThreadStartByte.exe' for writing -- 'The process cannot access the file 'C:\git\coreclr\bin\tests\obj\baseservices\threading\paramthreadstart\ThreadStartByte\ThreadStartByte.exe' because it is being used by another process.' [C:\git\coreclr\tests\src\baseservices\threading\paramthreadstart\ThreadStartByte.csproj]
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4411,5): error MSB3491: Could not write lines to file "C:\git\coreclr\tests\..\bin\tests\obj\baseservices\threading\paramthreadstart\ThreadStartObject\ThreadStartObject.csproj.FileListAbsolute.txt". The process cannot access the file 'C:\git\coreclr\bin\tests\obj\baseservices\threading\paramthreadstart\ThreadStartObject\ThreadStartObject.csproj.FileListAbsolute.txt' because it is being used by another process. [C:\git\coreclr\tests\src\baseservices\threading\paramthreadstart\ThreadStartObject.csproj]
C:\git\coreclr\tests\packages\Microsoft.DotNet.BuildTools.1.0.25-prerelease-00121\lib\sign.targets(39,5): error : C:\git\coreclr\tests\..\bin\tests\obj\baseservices\threading\paramthreadstart\ThreadStartChar\ThreadStartChar.exe: I/O error reading or writing PE file: The process cannot access the file 'C:\git\coreclr\bin\tests\obj\baseservices\threading\paramthreadstart\ThreadStartChar\ThreadStartChar.exe' because it is being used by another process. [C:\git\coreclr\tests\src\baseservices\threading\paramthreadstart\ThreadStartChar.csproj]

RussKeldorph avatar Jan 18 '16 05:01 RussKeldorph

I'm looking into this with @bryanar, we had the same conclusion you did about referencing BuildOnly's from RunOnlys.

wtgodbe avatar Jan 19 '16 19:01 wtgodbe

To be clear, the tests causing this failure are pri 1, not pri 2 (build priority 2 causes all priority 0, 1, and 2 tests to be built). I have a PR up to switch them to pri 2 temporarily so that all pri 1 and 0 tests can be built and run in the CI.

wtgodbe avatar Jan 20 '16 21:01 wtgodbe

This is not fixed. All that was done was to remove the failures when building priority 1. They are still there when building priority 2.

RussKeldorph avatar Jan 22 '16 02:01 RussKeldorph

CC @gkhanna79 @sergiy-k

rahku avatar Feb 22 '16 22:02 rahku

@wtgodbe Do you have an update on this?

gkhanna79 avatar Feb 22 '16 23:02 gkhanna79

Not yet, I need to work with @bryanar to take a look at this.

wtgodbe avatar Feb 23 '16 00:02 wtgodbe

This has been fixed by https://github.com/dotnet/coreclr/pull/3469

wtgodbe avatar Mar 08 '16 19:03 wtgodbe