Test failure: SuppressScope_False_CreatesNewScope
This issue was made automatically. If there is a problem contact ryanbrandenburg.
This test failed with the following error:
System.NullReferenceException : Object reference not set to an instance of an object.
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
at Castle.DynamicProxy.ModuleScope.GetFromCache(CacheKey key)
at Castle.DynamicProxy.Generators.BaseProxyGenerator.GetFromCache(CacheKey key)
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.Extensions.DependencyInjection.HttpClientFactoryServiceCollectionExtensionsTest.<>c__DisplayClass29_0.<SuppressScope_False_CreatesNewScope>b__0(IServiceProvider s) in /_/test/Microsoft.Extensions.Http.Test/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs:line 786
at Microsoft.Extensions.DependencyInjection.HttpClientBuilderExtensions.<>c__DisplayClass3_0.<AddHttpMessageHandler>b__1(HttpMessageHandlerBuilder b) in /_/src/Microsoft.Extensions.Http/DependencyInjection/HttpClientBuilderExtensions.cs:line 132
at Microsoft.Extensions.Http.DefaultHttpClientFactory.<>c__DisplayClass17_0.<CreateHandlerEntry>g__Configure|0(HttpMessageHandlerBuilder b) in /_/src/Microsoft.Extensions.Http/DefaultHttpClientFactory.cs:line 194
at Microsoft.Extensions.Http.LoggingHttpMessageHandlerBuilderFilter.<>c__DisplayClass2_0.<Configure>b__0(HttpMessageHandlerBuilder builder) in /_/src/Microsoft.Extensions.Http/Logging/LoggingHttpMessageHandlerBuilderFilter.cs:line 35
at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateHandlerEntry(String name) in /_/src/Microsoft.Extensions.Http/DefaultHttpClientFactory.cs:line 176
at Microsoft.Extensions.Http.DefaultHttpClientFactory.<>c__DisplayClass14_0.<.ctor>b__1() in /_/src/Microsoft.Extensions.Http/DefaultHttpClientFactory.cs:line 106
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateHandler(String name) in /_/src/Microsoft.Extensions.Http/DefaultHttpClientFactory.cs:line 143
at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateClient(String name) in /_/src/Microsoft.Extensions.Http/DefaultHttpClientFactory.cs:line 124
at Microsoft.Extensions.DependencyInjection.HttpClientBuilderExtensions.<>c__DisplayClass9_0`1.<AddTypedClient>b__0(IServiceProvider s) in /_/src/Microsoft.Extensions.Http/DependencyInjection/HttpClientBuilderExtensions.cs:line 326
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitTransient(TransientCallSite transientCallSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(IServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.HttpClientFactoryServiceCollectionExtensionsTest.SuppressScope_False_CreatesNewScope() in /_/test/Microsoft.Extensions.Http.Test/DependencyInjection/HttpClientFactoryServ
...
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 @rynowak
This comment was made automatically. If there is a problem contact ryanbrandenburg.
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)
- Yes?
- Is there any logging or extra information that we could add to make this more diagnosable when it happens again?
- Yes? Change the test!
- Is there is a way to change our test to avoid this flakiness?
@rynowak your favorite issue.
This should be resolved now