Skip to content

A couple of tests are flakey #41

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

Closed
dougbu opened this issue Dec 1, 2016 · 1 comment
Closed

A couple of tests are flakey #41

dougbu opened this issue Dec 1, 2016 · 1 comment
Assignees

Comments

@dougbu
Copy link
Contributor

dougbu commented Dec 1, 2016

See the following occasionally when building this repo locally. Haven't seen either failure on the CI but that rarely builds at all.

C:\dd\AspNetWebStack\tools\WebStack.xunit.targets(13,9): error : System.Web.Http.SelfHost.HttpSelfHostServerTest.SendAsync_ServiceModel_Throws_When_StreamContent_Throws(uri: "/SelfHostServerTest/ThrowBeforeWriteStream", transferMode: Buffered) [FAIL]
        Microsoft.TestCommon.Assert+ThrowsException : Assert.Throws() Failure
        Expected: typeof(System.Net.Http.HttpRequestException)
        Actual:   typeof(System.Threading.Tasks.TaskCanceledException): A task was canceled.
             at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
             at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

and

C:\dd\AspNetWebStack\test\System.Web.Mvc.Test\Test\DataAnnotationsModelValidatorTest.cs(99): error : System.Web.Mvc.Test.DataAnnotationsModelValidatorTest.NoClientRulesByDefault [FAIL] [C:\dd\AspNetWebStack\tools\WebStack.xunit.targets]
        System.InvalidOperationException : Operation is not valid due to the current state of the object.
             at Moq.MethodCall.Execute(ICallContext call)
             at Moq.MethodCallReturn`2.Execute(ICallContext call)
             at Moq.ExecuteCall.HandleIntercept(ICallContext invocation, InterceptorContext ctx, CurrentInterceptContext localctx)
             at Moq.Interceptor.Intercept(ICallContext invocation)
             at Moq.Proxy.CastleProxyFactory.Interceptor.Intercept(IInvocation invocation)
             at Castle.DynamicProxy.AbstractInvocation.Proceed()
             at Castle.Proxies.ModelMetadataProviderProxy.GetMetadataForProperty(Func`1 modelAccessor, Type containerType, String propertyName)
          C:\dd\AspNetWebStack\test\System.Web.Mvc.Test\Test\DataAnnotationsModelValidatorTest.cs(99,0): at System.Web.Mvc.Test.DataAnnotationsModelValidatorTest.NoClientRulesByDefault()
@danroth27 danroth27 added the task label Mar 3, 2017
dougbu added a commit that referenced this issue Oct 20, 2017
…rrent` readers

- #41
  - have not seen similar `InvalidOperationException`s in other test classes
- `DisplayExtensionsTest` and `EditorExtensionsTest` are already in this increasingly-poorly named collection
  - they temporarily change `ModelMetadataProviders.Current` to reference a `Mock<ModelMetadataProvider>`

This is a **temporary** fix: should use `[CollectionDefinition(DisableParallelization = true)]` xUnit v2.3.0
  - i.e. create an isolated collection containing just `DisplayExtensionsTest` and `EditorExtensionsTest`
dougbu added a commit that referenced this issue Oct 22, 2017
…rrent` readers

- #41
  - have not seen similar `InvalidOperationException`s in other test classes
- `DisplayExtensionsTest` and `EditorExtensionsTest` are already in this increasingly-poorly named collection
  - they temporarily change `ModelMetadataProviders.Current` to reference a `Mock<ModelMetadataProvider>`

This is a **temporary** fix: should use `[CollectionDefinition(DisableParallelization = true)]` xUnit v2.3.0
  - i.e. create an isolated collection containing just `DisplayExtensionsTest` and `EditorExtensionsTest`
@dougbu
Copy link
Contributor Author

dougbu commented Oct 23, 2017

f098836

@dougbu dougbu closed this as completed Oct 23, 2017
@dougbu dougbu added this to the 5.2.4 milestone Oct 23, 2017
@dougbu dougbu self-assigned this Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants