Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Change corefx test process#16263

Merged
BruceForstall merged 4 commits into
dotnet:masterfrom
BruceForstall:ChangeCoreFxTesting
Feb 9, 2018
Merged

Change corefx test process#16263
BruceForstall merged 4 commits into
dotnet:masterfrom
BruceForstall:ChangeCoreFxTesting

Conversation

@BruceForstall
Copy link
Copy Markdown

Instead of using the /p:CoreCLROverridePath switch when building
corefx, to bring in coreclr, build corefx normally. This builds
against the coreclr packages that corefx has already been validated
against in the CI, so the build should always work. Then, copy
over our built coreclr bits before testing. This method is expected
to have better behavior in most breaking change scenarios.

Instead of using the `/p:CoreCLROverridePath` switch when building
corefx, to bring in coreclr, build corefx normally. This builds
against the coreclr packages that corefx has already been validated
against in the CI, so the build should always work. Then, copy
over our built coreclr bits before testing. This method is expected
to have better behavior in most breaking change scenarios.
@BruceForstall
Copy link
Copy Markdown
Author

@dotnet-bot test Ubuntu x64 Checked corefx_baseline
@dotnet-bot test Windows_NT arm Cross Checked corefx_baseline Build and Test
@dotnet-bot test Windows_NT x64 Checked corefx_baseline
@dotnet-bot test Windows_NT x64_arm64_altjit Checked corefx_baseline
@dotnet-bot test Windows_NT x86 Checked corefx_baseline
@dotnet-bot test Windows_NT x86_arm_altjit Checked corefx_baseline

Copy link
Copy Markdown
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Feb 7, 2018

Once this is merged, could you please submit a test PR that introduces a break e.g. in some rarely used reflection API and verify that the corefx legs will fail as expected?

Comment thread tests/scripts/run-corefx-tests.py Outdated
# We used to pass the argument:
# -- /p:CoreCLROverridePath=<path-to-core_root>
# which causes the corefx build to overwrite its built core_root with the binaries from
# the coreclr build. However, this often causes build failures which breaking changes are
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which->when

Comment thread tests/scripts/run-corefx-tests.py Outdated
# the coreclr build. However, this often causes build failures which breaking changes are
# in progress (e.g., a breaking change is made in coreclr that has not yet had compensating
# changes made in the corefx repo). Instead, build corefx normally. This should always work
# since corefx is protected by a CI testing system. Then, overwrite the built corex
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corex->corefx

# Override the built corefx runtime (which it picked up by copying from packages determined
# by its dependencies.props file). Note that we always build Release corefx.
# TODO: it might be cleaner to encapsulate the knowledge of how to do this in the
# corefx msbuild files somewhere.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Could you open an issue in CoreFx explaining our scenario and see if you can get someone to add something like CoreCLROverridePath that only uses the overriding runtime for running, not building?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BruceForstall
Copy link
Copy Markdown
Author

Once this is merged, could you please submit a test PR that introduces a break e.g. in some rarely used reflection API and verify that the corefx legs will fail as expected?

@jkotas Like removing an API? Can you suggest one?

Note that my runs using the current (old) script fail to build due to dotnet/corefx#26933 (that is, until that PR is merged)

@BruceForstall
Copy link
Copy Markdown
Author

@dotnet-bot test Ubuntu x64 Checked corefx_baseline
@dotnet-bot test Windows_NT arm Cross Checked corefx_baseline Build and Test
@dotnet-bot test Windows_NT x64 Checked corefx_baseline
@dotnet-bot test Windows_NT x64_arm64_altjit Checked corefx_baseline
@dotnet-bot test Windows_NT x86 Checked corefx_baseline
@dotnet-bot test Windows_NT x86_arm_altjit Checked corefx_baseline

@BruceForstall
Copy link
Copy Markdown
Author

We still need a way to disable tests when running corefx tests using this script/system, in the CI. The corefx tests are invoked with the "build-tests" script in corefx, which eventually invokes xunit, something like:

call %RUNTIME_PATH%\dotnet.exe xunit.console.netcore.exe System.Collections.Tests.dll  -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonwindowstests  -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing

We can't touch the corefx tests, since we want the disabling to happen purely on the coreclr side. That would imply some kind of "exclusion file". xunit doesn't have such a mechanism now (and can we do work to add one?). Possibly we could add a simple per-assembly exclusion list by adding magic to the corefx generated RunTests.cmd wrappers to check, "Am I disabled?" and skipping if so. I've gotten lots of pushback before adding things to this file. Or, maybe the wrapper generator itself could look up exclusions based on a provided file (kind of like how the coreclr issues.targets file works?)

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Feb 8, 2018

xunit doesn't have such a mechanism now

xunit driver that we are using to run CoreFX tests is our own (https://github.com/dotnet/buildtools/tree/master/src/xunit.console.netcore), so we can presumably teach it to have exlusion list command line option.

Even better would be a build-time xunit driver optimized for runtime developers that does not discover tests using reflection. It would make things way a lot easier to debug.

@BruceForstall
Copy link
Copy Markdown
Author

@dotnet-bot test Ubuntu x64 Checked corefx_baseline
@dotnet-bot test Windows_NT arm Cross Checked corefx_baseline Build and Test
@dotnet-bot test Windows_NT x64 Checked corefx_baseline
@dotnet-bot test Windows_NT x64_arm64_altjit Checked corefx_baseline
@dotnet-bot test Windows_NT x86 Checked corefx_baseline
@dotnet-bot test Windows_NT x86_arm_altjit Checked corefx_baseline

@BruceForstall
Copy link
Copy Markdown
Author

@dotnet-bot test Ubuntu x64 Checked corefx_baseline
@dotnet-bot test Windows_NT arm Cross Checked corefx_baseline Build and Test
@dotnet-bot test Windows_NT x64 Checked corefx_baseline
@dotnet-bot test Windows_NT x64_arm64_altjit Checked corefx_baseline
@dotnet-bot test Windows_NT x86 Checked corefx_baseline
@dotnet-bot test Windows_NT x86_arm_altjit Checked corefx_baseline

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Feb 8, 2018

@jkotas Like removing an API? Can you suggest one?

AssemblyName.SetPublicToken
https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Reflection/AssemblyName.cs#L216

@BruceForstall
Copy link
Copy Markdown
Author

@dotnet-bot test Ubuntu x64 Checked corefx_baseline
@dotnet-bot test Windows_NT arm Cross Checked corefx_baseline Build and Test
@dotnet-bot test Windows_NT x64 Checked corefx_baseline
@dotnet-bot test Windows_NT x64_arm64_altjit Checked corefx_baseline
@dotnet-bot test Windows_NT x86 Checked corefx_baseline
@dotnet-bot test Windows_NT x86_arm_altjit Checked corefx_baseline

@BruceForstall
Copy link
Copy Markdown
Author

@jkotas I'm seeing ~3500 XML-related corefx test failures here, but it turns out they're also in the baseline (without this change to the corefx test process), e.g.:

https://ci.dot.net/job/dotnet_coreclr/job/master/job/jitstress/job/x64_checked_ubuntu_corefx_baseline_prtest/202/

or the cron job:

https://ci.dot.net/job/dotnet_coreclr/job/master/job/jitstress/job/x64_checked_ubuntu_corefx_baseline/428/

It isn't just Ubuntu; happens on Windows, too.

Have you seen this?

@BruceForstall
Copy link
Copy Markdown
Author

Seems like lots of errors are of the form:

System.IO.FileNotFoundException : File Not Found: testdata\\xmlreader\\Common\\bug_62146.xml

and I can't find those input files on my machine, either.

@BruceForstall
Copy link
Copy Markdown
Author

btw, the console output on Windows is practically unintelligible due to interleaving multiple xunit invocations. Is that because msbuild is doing the invoking and running multiple threads? Is there a way to better serialize the output? (Does it actually make sense for msbuild to be parallelizing while xunit is also parallelizing?)

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Feb 8, 2018

I can't find those input files on my machine, either.

These files are created by
https://raw.githubusercontent.com/dotnet/corefx/master/src/Common/tests/System/Xml/XmlCoreTest/TestData.g.cs . The initializer that creates these files seems to be failing and so everything that depends on it fails too.

Do you see the same failure when you run it locally?

Does it actually make sense for msbuild to be parallelizing while xunit is also parallelizing?

I expect that you would see pretty measurable slowdown if you disabled msbuild level parallelization. A good chunk of xunit process runs single threaded.

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Feb 8, 2018

It looks like a recent regression: dotnet/corefx#26940 (comment)

@Anipik

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Feb 8, 2018

@dotnet-bot test Ubuntu x64 Checked corefx_baseline
@dotnet-bot test Windows_NT x64 Checked corefx_baseline

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Feb 8, 2018

The XML failures are gone. The only remaining one is System.Tests.MathFTests:Cbrt.

@BruceForstall BruceForstall merged commit b4fc69e into dotnet:master Feb 9, 2018
@BruceForstall BruceForstall deleted the ChangeCoreFxTesting branch February 9, 2018 01:00
@BruceForstall
Copy link
Copy Markdown
Author

fyi, the failure is tracked as https://github.com/dotnet/coreclr/issues/16272

# TODO: it might be cleaner to encapsulate the knowledge of how to do this in the
# corefx msbuild files somewhere.

fx_runtime = os.path.join(fx_root,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a good idea. It will likely break whenever we change the layout of corefx output. We don't want to be responsible for updating random scripts like this that are taking a hard-coded dependency on the output of corefx repo.

If the options of CoreCLROverridePath isn't doing what you need it to then we should fix that or provide another public hook instead of depending on these paths here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants