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

Perf tests are broken when run from project test directory #23604

Closed
stephentoub opened this issue Sep 19, 2017 · 16 comments
Closed

Perf tests are broken when run from project test directory #23604

stephentoub opened this issue Sep 19, 2017 · 16 comments

Comments

@stephentoub
Copy link
Member

I'm trying to build and run the System.Collections perf tests. Following the instructions at https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/performance-tests.md, I did a:

git clean -xdf
build -release

from the root of my repo, and then from src\System.Collections\tests\Performance did:

msbuild /t:BuildAndTest /p:Performance=true /p:ConfigurationGroup=Release /p:TargetOS=Windows_NT

and I get the error:

The application to execute does not exist: 'corefx\bin\tests\System.Collections.Performance.Tests\netcoreapp-Windows_NT-Release-x64\PerfRunner.exe'
@stephentoub
Copy link
Member Author

cc: @mellinoe, this is the issue I mentioned to you.

@mellinoe
Copy link
Contributor

I talked with @DrewScoggins about this a little bit at the end of the day. The tests work if you run them with the root script, but not if you use the command above. The CI tests use this command line, which Drew and I were able to use successfully:

build-managed.cmd -release -tests -- /p:Performance=true /p:TargetOS=${osGroup} /m:1

This is obviously not ideal (or even workable, really), considering how long this takes.

We didn't figure out exactly why building projects directly didn't work, but it had something to do with the tests building and running out of the wrong directory.

@stephentoub
Copy link
Member Author

Thanks, @mellinoe and @DrewScoggins.

This is obviously not ideal (or even workable, really)

Yeah, this isn't viable. That's fine for doing a full run to see where we currently stand, but it essentially prohibits writing any new performance tests.
cc: @danmosemsft

@stephentoub stephentoub changed the title Perf tests unable to find runner? Perf tests are broken when run from project test directory Sep 20, 2017
@danmoseley
Copy link
Member

@DrewScoggins @brianrob can someone take a look why this broke? Your team will need this, to write more tests.

@brianrob
Copy link
Member

@DrewScoggins, can you please take a look at this?

@DrewScoggins
Copy link
Member

Yeah, I have already started working on this.

@brianrob
Copy link
Member

Thanks!

@stephentoub
Copy link
Member Author

Thanks, @DrewScoggins .

@DrewScoggins
Copy link
Member

Sorry, this has taken a couple of days. I have had some other stuff going on.

I looked into this and the problem seems to be happening in the GetBinPlaceConfiguration task. In that task we setup the BinPlaceDir ItemGroup, but only do that if we have a definition of _currentBinPlaceConfigurations. This is not being set because of this condition, Condition="'%(Identity)' == '$(Configuration)' OR '%(Identity)-$(ConfigurationGroup)' == '$(Configuration)'". When we run the CI the configuration property is getting set to Configuration = netcoreapp-Windows_NT-Release, but when we manually call the csproj it is set this way, Configuration = netcoreapp-Windows_NT-Release-x64. And if you look at the condition all of the Identity variables are of the form netcoreapp-Windows_NT and will never end up evaluating true.

I did some digging here, and could not come up with a reason why we were seeing this behavior. Does anyone else with a little better knowledge of the build system and MSBuild have an idea what is causing this?

@danmoseley
Copy link
Member

@joperezr ?

@joperezr
Copy link
Member

I'm pretty sure that this is caused by the recent changes that @safern made around changing the testPath location. The reason why I think that is that I tried this out locally and both the test assembly and the PerfRunner.exe where dropped to corefx\bin\Windows_NT.AnyCPU.Release\System.Collections.Performance.Tests\netcoreapp folder, which is what we used to have before his change. On the other hand, RunTests.cmd is located at corefx\bin\tests\System.Collections.Performance.Tests\netcoreapp-Windows_NT-Release-x64\ which is the path that gets set after his changes.

@safern
Copy link
Member

safern commented Sep 25, 2017

Yes this looks like it’s affected by my change. I might have missed to include the bin placing configuration when running perf tests. I will take a look. Self assigned.

@safern safern self-assigned this Sep 25, 2017
@mellinoe
Copy link
Contributor

Thanks for looking into it! If there was something that recently changed the test paths, then I would definitely think that it is related.

@stephentoub
Copy link
Member Author

@safern, any progress on this?

@safern
Copy link
Member

safern commented Oct 5, 2017

@safern, any progress on this?

Yes I started taking a look yesterday afternoon and I'm close to get the fix. Will update you soon when I get it.

@safern
Copy link
Member

safern commented Oct 6, 2017

Fix is out: dotnet/corefx#24493

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants