aspnet / Identity

[Archived] ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
1.96k stars 869 forks source link

Test failure: CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter #1922

Closed ryanbrandenburg closed 5 years ago

ryanbrandenburg commented 6 years ago

This test fails occasionally with the following error:

System.IO.IOException : Undefined error: 0
   at System.IO.FileSystemWatcher.RunningInstance.Start()
   at System.IO.FileSystemWatcher.StartRaisingEvents()
   at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
   at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
   at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.TryEnableFileSystemWatcher()
   at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter)
   at Microsoft.AspNetCore.Mvc.RazorPages.Internal.PageActionDescriptorChangeProvider.GetChangeToken()
   at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
   at Microsoft.AspNetCore.Mvc.Internal.ActionDescriptorCollectionProvider..ctor(IEnumerable`1 actionDescriptorProviders, IEnumerable`1 actionDescriptorChangeProviders)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitTransient(TransientCallSite transientCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app, Action`1 configureRoutes)
   at Identity.DefaultUI.WebSite.StartupBase`2.Configure(IApplicationBuilder app, IHostingEnvironment env)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.StartAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.TestHost.TestServer..ctor(IWebHostBuilder builder, IFeatureCollection featureCollection)
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateServer(IWebHostBuilder builder)
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.EnsureServer()
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateDefaultClient(DelegatingHandler[] handlers)
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateClient(WebApplicationFactoryClientOptions options)
   at Microsoft.AspNetCore.Identity.FunctionalTests.LoginTests`2.CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter()
--- End of stack trace from previous location where exception was thrown ---

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 @Eilon (because the bot doesn't know who else to pick)

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

ryanbrandenburg commented 6 years ago

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

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

ryanbrandenburg commented 6 years ago

CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on master. CanSetPasswordWithExternalLogin failed with about the same error on 2.2. CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on master. CanLogInAfterConfirmingEmail failed with about the same error on 2.2.

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

ryanbrandenburg commented 6 years ago

CanSetPasswordWithExternalLogin failed with about the same error on 2.2. CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on master. CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on 2.2. CanSetPasswordWithExternalLogin failed with about the same error on master.

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

ryanbrandenburg commented 6 years ago

CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on master. CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on 2.2.

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

ryanbrandenburg commented 6 years ago

CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on 2.2.

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

aspnet-hello commented 6 years ago

CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on 2.2.

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

aspnet-hello commented 6 years ago

CanSetPasswordWithExternalLogin failed with about the same error on master. CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on 2.2. CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on master. CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on 2.2.

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

aspnet-hello commented 6 years ago

CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on master. CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on master.

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

aspnet-hello commented 6 years ago

CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on master.

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

Eilon commented 6 years ago

@mkArtakMSFT - can you assign? Call stack looks related to Razor Pages.

aspnet-hello commented 6 years ago

CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on master.

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

aspnet-hello commented 6 years ago

CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on master. CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on master.

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

ryanbrandenburg commented 5 years ago

@mkArtakMSFT was this resolved? If so how? Please assign someone to find out.

mkArtakMSFT commented 5 years ago

@javiercn, can you please look into this and close if this is resolved already. Otherwise - just come up with a fix please.

javiercn commented 5 years ago

@pranavkm I think this is likely related to exhausting the number of file descriptors, but I think we took action for it. Didn’t we?

javiercn commented 5 years ago

I checked and it seems like we did. Given that all the views are precompiled. Would it be problematic if we remove all the file providers from razor view engine options? That way there wouldn’t be any file watching going on, based on what I see on DefaultRazorViewEngineFileProviderAccessor. Does that make sense @pranavkm

pranavkm commented 5 years ago

Would it be problematic if we remove all the file providers from razor view engine options?

Think the compiler throws if you have no fileproviders. You might have to hack it a bit. More specifically we don't watch for files in Release builds which is usually what exhausts file descriptors.

javiercn commented 5 years ago

@pranavkm would it be a problem if we just add a bogus one instead? The callstack looks pretty descriptive to me.

pranavkm commented 5 years ago

Adding a CompositeFileProvider that contains a single NullFileProvider might not throw. Highlighting the relevant pieces

javiercn commented 5 years ago

https://github.com/aspnet/Identity/commit/95bc2518486554be18191211e70a2ac8e8765ed3