Skip to content
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

Test Failure: IHostApplicationLifetimeRegisteredEvenWhenStartupCtorThrows_Fallback #30701

Closed
sebastienros opened this issue Mar 5, 2021 · 2 comments
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions test-failure

Comments

@sebastienros
Copy link
Member

Build: https://dev.azure.com/dnceng/public/_build/results?buildId=1024610&view=results

 Failed Microsoft.AspNetCore.Hosting.WebHostBuilderTests.IHostApplicationLifetimeRegisteredEvenWhenStartupCtorThrows_Fallback(builder: GenericWebHostBuilderWrapper { }) [2 ms]
  Error Message:
   Assert.Equal() Failure
           ↓ (pos 1)
Expected: 0123456789abcdef
Actual:   0000000000000000
           ↑ (pos 1)
  Stack Trace:
     at Microsoft.AspNetCore.Hosting.Tests.HostingApplicationDiagnosticsTests.<>c.<ActivityListenersAreCalled>b__17_2(Activity activity) in /_/src/Hosting/Hosting/test/HostingApplicationDiagnosticsTests.cs:line 506
   at System.Diagnostics.ActivitySource.<>c.<NotifyActivityStart>b__24_0(ActivityListener listener, Object obj)
   at System.Diagnostics.SynchronizedList`1.EnumWithAction(Action`2 action, Object arg)
   at System.Diagnostics.ActivitySource.NotifyActivityStart(Activity activity)
   at System.Diagnostics.Activity.Start()
   at Microsoft.AspNetCore.Hosting.HostingApplicationDiagnostics.StartActivity(HttpContext httpContext, Boolean loggingEnabled, Boolean diagnosticListenerActivityCreationEnabled, Boolean& hasDiagnosticListener) in /_/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs:line 309
   at Microsoft.AspNetCore.Hosting.HostingApplication.CreateContext(IFeatureCollection contextFeatures) in /_/src/Hosting/Hosting/src/Internal/HostingApplication.cs:line 80
   at Microsoft.AspNetCore.Hosting.WebHostBuilderTests.TestServer.<>c__DisplayClass8_0`1.<<StartAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Hosting.WebHostBuilderTests.AssertResponseContains(RequestDelegate app, String expectedText) in /_/src/Hosting/Hosting/test/WebHostBuilderTests.cs:line 1505
   at Microsoft.AspNetCore.Hosting.WebHostBuilderTests.IHostApplicationLifetimeRegisteredEvenWhenStartupCtorThrows_Fallback(IWebHostBuilder builder) in /_/src/Hosting/Hosting/test/WebHostBuilderTests.cs:line 177
--- End of stack trace from previous location ---
  Passed Microsoft.AspNetCore.Hosting.WebHostBuilderTests.CodeBasedSettingsCodeBasedOverride(builder: WebHostBuilder { }) [< 1 ms]
  Passed Microsoft.AspNetCore.Hosting.WebHostBuilderTests.CodeBasedSettingsCodeBasedOverride(builder: GenericWebHostBuilderWrapper { }) [< 1 ms]
Application startup exception: System.IO.FileNotFoundException: Could not load file or assembly 'MissingStartupAssembly, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

File name: 'MissingStartupAssembly, Culture=neutral, PublicKeyToken=null'
   at System.Reflection.RuntimeAssembly.InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Boolean throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
   at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, RuntimeAssembly requestingAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at Microsoft.AspNetCore.Hosting.StartupLoader.FindStartupType(String startupAssemblyName, String environmentName) in /_/src/Hosting/Hosting/src/Internal/StartupLoader.cs:line 237
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors) in /_/src/Hosting/Hosting/src/WebHostBuilder.cs:line 302
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.<>c__DisplayClass14_2.<BuildCommonServices>b__2(IServiceProvider _) in /_/src/Hosting/Hosting/src/WebHostBuilder.cs:line 323
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.ResolveService(ServiceCallSite callSite, RuntimeResolverContext context, RuntimeResolverLock lockType, ServiceProviderEngineScope serviceProviderEngine)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite 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.GetService[T](IServiceProvider provider)
   at Microsoft.AspNetCore.Hosting.WebHost.EnsureStartup() in /_/src/Hosting/Hosting/src/Internal/WebHost.cs:line 209
   at Microsoft.AspNetCore.Hosting.WebHost.EnsureApplicationServices() in /_/src/Hosting/Hosting/src/Internal/WebHost.cs:line 196
   at Microsoft.AspNetCore.Hosting.WebHost.Initialize() in /_/src/Hosting/Hosting/src/Internal/WebHost.cs:line 122
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Hosting.WebHost.BuildApplication() in /_/src/Hosting/Hosting/src/Internal/WebHost.cs:line 226
@JunTaoLuo
Copy link
Contributor

Duplicate of #30582

@JunTaoLuo JunTaoLuo marked this as a duplicate of #30582 Mar 5, 2021
@JunTaoLuo
Copy link
Contributor

The true culprit is ActivityListenersAreCalled which I am disabling in https://github.com/dotnet/aspnetcore/pull/30672/files

@ghost ghost locked as resolved and limited conversation to collaborators Apr 4, 2021
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions test-failure
Projects
None yet
Development

No branches or pull requests

4 participants