Disable parallel test runs for Nancy.Tests - #2703
Conversation
|
Copied this from #2702 @blairconrad It's not unlikely that StaticConfiguration is the cause of the problem. I've previously added a task to remove the last, remaining parts, of StaticConfiguration in #2659 A while back I also created StaticConfigurationContext to help mitigate race conditions, in tests, that used StaticConfiguration values. It looks like DefaultRouteResolverFixture does not use it.. would be interesting to see if adding it would solve the intermittent test failtures |
|
@thecodejunkie, StaticConfigurationContext looks like it would help for serialized tests, but I think won't protect us when the tests are run in parallel. Unless I'm missing something, it performs no synchronization, so the other fixtures could still muck about with the setting, no? |
|
I'm not sure what to make of the Travis failure. At work, so no time/ability to investigate. |
|
… at least it's not the first time it's failed |
|
I'm kind of tempted to think that it's also |
|
Interesting idea, @thecodejunkie. If you'd like, I could try disabling the parallel execution on Nancy.Testing.Tests as well. (But where will it all end!? 😉) |
|
To be honest, we're working on removing |
|
Fair enough. Should we close this PR then? |
|
Does that assemblyinfo change work for netcore tests? |
|
Seems to. Test times jump from about 21–22 seconds to about 34–35 seconds when I add the |
|
In netcore you pass it to the runner eg I think you'd have to amend the build.cake to pass that argument |
|
@jchannon, I would be the first to admit that I don't fully understand .NET Core or XUnit, but I'm confused by your earlier comments.
This seems to be a way to disable parallel test execution, but I don't think it's the only way.
I don't know exactly what you're suggesting by "doesn't know what assembly info is". The file is built into the assembly. The attribute does appear when I reflect the assembly. And as I explain below, it seems to make a difference. Also, in a separate project, I'm including an equivalent file in the build, specifying assembly version numbers, and they are respected. I think it would be up to XUnit to interpret the attribute once it's there; this wouldn't be something directly controlled by .NET Core. I took a peek at the XUnit source, and it seems to be treating the
|
|
Oh, and is the whole discussion moot, since you're trying to get rid of |
|
In case we're keeping track, we've another failed build. But at this I'm more interested in knowing whether
Thanks! |
|
@NancyFx/most-valued-minions @NancyFx/owners I think we should pull this in for now.. it seems that it's causing test failures in most PRs after we enabled more test projects to run on core. Any objections? |
|
nope do it
…On 14 March 2017 at 12:52, Andreas Håkansson ***@***.***> wrote:
@NancyFx/most-valued-minions
<https://github.com/orgs/NancyFx/teams/most-valued-minions>
@NancyFx/owners <https://github.com/orgs/NancyFx/teams/owners> I think we
should pull this in for now.. it seems that it's causing test failures in
most PRs after we enabled more test projects to run on core. Any objections?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2703 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAGapjW5IYYfXcQW7HlrbqYtA6O4sSJGks5rlo2rgaJpZM4L8OHl>
.
|
|
Want a rebase? |
|
Rather, object to a rebase? |
Several fixtures manipulate (and possibly more depend on) the static field StaticConfiguration.CaseSensitive, causing interference.
|
Ah, to heck with it. I'm rebasing. |
|
Thanks, @thecodejunkie! |
|
@blairconrad thank you! 👍 |
Several fixtures manipulate (and possibly more depend on) the static field
StaticConfiguration.CaseSensitive, causing interference.
Prerequisites
Description
Disable test run parallelization for Nancy.Tests.
I noticed intermittent test failures in this module (even on master, on Windows) during my work on #2634. After further investigation performed as described in #2702, helped along with comments from @xt0rted and @jchannon, I see that both
Nancy.Tests.Unit.RequestFixtureandNancy.Tests.Unit.Routing.DefaultRouteResolverFixturesetStaticConfiguration.CaseSensitive`. I figured this to be a primary cause of the failures.I ran
dotnet test -c Releasein Nancy.Tests repeatedly on Windows on the master branch, then disabled test parallelization and repeated.Here's what I found:
With parallelization enabled (as
masterhas it), tests failed after various numbers of runs:7, 3, 6, 1, 2, 2, 2, 3, 1, 2, 1, 3, 1, 1, 1, 8, 11, 4, 2, 1, 2, 1, 1, 12, 7, 3, 1, 1, 7, 1, 8, 15, 10, 1, 4, 3, 3, 1 , 2, 1, 1, 2, 1, 2, 1, 4, 14, 3, 14, 10, 3, 1, 1, 2, 3, 3, 1, 4, 5, 6, 1, 9, 7, 4, 12, 7, 1, 5, 3, 1, 6, 9, 6, 1, 6, 2, 2, 1, 1, 2, 2, 2, 6, 2, 1 , 5, 11, 4, 4, 2, 1, 3, 7, 3, 3, 6, 2, 10, 1, 1, 26, 2, 1, 7, 4, 10, 2, 1, 12, 2, 1, 1, 7, 1, 1, 4, 1, 7, 6, 2, 4, 1, 1, 4, 3, 2, 2, 1, 3, 1, 2, 3, 1, 2, 5, 2, 7, 7, 2, 6, 6, 1, 1, 1, 2, 4, 3, 6, 4, 2, 13, 1, 8, 2, 2, 10, 8, 1, 6, 5, 3, 6, 2, 1, 5, 1, 2, 1, 10, 9, 4, 3, 5, 6, 2, 9, 3, 1, 2 , 17, 1, 9, 3, 4, 5, 5, 1, 2, 5, 1, 4, 2, 1, 1, 1, 1, 8, 2, 2, 1, 5, 8, 2, 2, 2, 3, 3, 2, 2, 1, 1, 3, 4, 3, 3, 1, 3, 1, 2, 1, 1, 3, 3, 1
With parallelization disabled, the tests did not fail once in over 200 runs.
Here's a picture:
It's possible that a more sophisticated fix could be found, but in the interim, I propose disabling parallel test execution.