Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Test failure: DisplayTextFor_ReturnsSimpleDisplayText_IfSetAndValueNonNull #8487

Closed
aspnet-hello opened this issue Sep 21, 2018 · 3 comments
Closed

Comments

@aspnet-hello
Copy link

This test fails occasionally with the following error:

System.BadImageFormatException : Index not found. (Exception from HRESULT: 0x80131124)
   at System.RuntimeTypeHandle.ConstructName(RuntimeTypeHandle handle, TypeNameFormatFlags formatFlags, StringHandleOnStack retString)
   at System.RuntimeType.RuntimeTypeCache.ConstructName(String& name, TypeNameFormatFlags formatFlags)
   at Castle.DynamicProxy.Generators.BaseProxyGenerator.ObtainProxyType(CacheKey cacheKey, Func`3 factory)
   at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] interfaces, ProxyGenerationOptions options)
   at Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
   at Castle.DynamicProxy.ProxyGenerator.CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
   at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors)
   at Moq.Proxy.CastleProxyFactory.CreateProxy(Type mockType, ICallInterceptor interceptor, Type[] interfaces, Object[] arguments)
   at Moq.Mock`1.<InitializeInstance>b__20_0()
   at Moq.PexProtector.Invoke(Action action)
   at Moq.Mock`1.InitializeInstance()
   at Moq.Mock`1.OnGetObject()
   at Moq.Mock.GetObject()
   at Moq.Mock.get_Object()
   at Moq.Mock`1.get_Object()
   at Moq.Mocks.CreateMocks[T]()+MoveNext()
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at System.Linq.EnumerableExecutor`1.Execute()
   at System.Linq.EnumerableQuery`1.System.Linq.IQueryProvider.Execute[TElement](Expression expression)
   at System.Linq.Queryable.First[TSource](IQueryable`1 source)
   at Moq.Linq.MockQueryable`1.Execute[TResult](Expression expression)
   at System.Linq.Queryable.First[TSource](IQueryable`1 source)
   at Moq.Mock.Of[T]()
   at Microsoft.AspNetCore.Mvc.Rendering.DefaultTemplatesUtilities.GetHtmlHelper[TModel](ViewDataDictionary`1 viewData, IUrlHelper urlHelper, ICompositeViewEngine viewEngine, IModelMetadataProvider provider, IStringLocalizerFactory localizerFactory, Func`2 innerHelperWrapper, IHtmlGenerator htmlGenerator, String idAttributeDotReplacement) in /_/test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/Rendering/DefaultTemplatesUtilities.cs:line 296
   at Microsoft.AspNetCore.Mvc.Rendering.DefaultTemplatesUtilities.GetHtmlHelper[TModel](TModel model, IUrlHelper urlHelper, ICompositeViewEngine viewEngine, IModelMetadataProvider provider, IStringLocalizerFactory localizerFactory, Func`2 innerHelperWrapper) in /_/test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/Rendering/DefaultTemplatesUtilities.cs:line 213
   at Microsoft.AspNetCore.Mvc.Rendering.DefaultTemplatesUtilities.GetHtmlHelper[TModel](TModel model, IUrlHelper urlHelper, ICompositeViewEngine viewEngine, IModelMetadataProvider provider, IStringLocalizerFactory localizerFactory) in /_/test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/Rendering/DefaultTemplatesUtilities.cs:line 199
   at Microsoft.AspNetCore.Mvc.Rendering.DefaultTemplatesUtilities.GetHtmlHelper[TModel](TModel model, IModelMetadataProvider provider) in /_/test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/Rendering/DefaultTemplatesUtilities.cs:line 162
   at Microsoft.AspNetCore.Mvc.Rendering.HtmlHelperDisplayTextTest.DisplayTextFor_ReturnsSimpleDisplayText_IfSetAndValueNonNull() in /_/test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/Rendering/HtmlHelperDisplayTextTest.cs:line 163

Other tests within that build may have failed with a similar message, but they are not listed here. Check the link above for more info.

This test failed on 2.2.

CC @mkArtakMSFT

This issue was made automatically. If there is a problem contact ryanbrandenburg.

@aspnet-hello
Copy link
Author

Please use this workflow to address this flaky test issue, including checking applicable checkboxes and filling in the applicable "TODO" entries:

  • Is this actually a flaky test?

    • No, this is a regular test failure, fix the test/product (TODO: Link to commit/PR)
    • Yes, proceed below...
  • Is this test failure caused by product code flakiness? (Either this product, or another product this test depends on.)

    • File a bug against the product (TODO: Link to other bug)
    • Is it possible to change the test to avoid the flakiness?
      • Yes? Go to the "Change the test!" section.
      • No?
        • Disable the test (TODO: Link to PR/commit)
        • Wait for other bug to be resolved
        • Wait for us to get build that has the fix
        • Re-enable our test (TODO: Link to PR/commit)
        • Close this bug
  • Is it that the test itself is flaky? This includes external transient problems (e.g. remote server problems, file system race condition, etc.)

    • Is there is a way to change our test to avoid this flakiness?
      • Yes? Change the test!
        • Change the test to avoid the flakiness, for example by using a different test strategy, or by adding retries w/ timeouts (TODO: Link to PR/commit)
        • Run the test 100 times locally as a sanity check.
        • Close this bug
      • No?
        • Is there any logging or extra information that we could add to make this more diagnosable when it happens again?
          • Yes?
            • Add the logging (TODO: Link to PR/commit)
          • No?
            • Delete the test because flaky tests are not useful (TODO: Link to PR/commit)

This comment was made automatically. If there is a problem contact ryanbrandenburg.

@mkArtakMSFT
Copy link
Member

@NTaylorMullen, can you please look into this? Thanks!

@NTaylorMullen
Copy link
Member

Issue with Moq - castleproject/Core#193. Using #8157 to track upgrading the dependency.

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

3 participants