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: CannotLogInWithoutRequiredEmailConfirmation_WithGlobalAuthorizeFilter #1926

Closed ryanbrandenburg closed 6 years ago

ryanbrandenburg commented 6 years ago

This test fails occasionally with the following error:

System.OutOfMemoryException : Exception of type 'System.OutOfMemoryException' was thrown.
   at System.Threading.Thread.StartInternal()
   at System.Threading.Thread.Start(Object parameter)
   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.TagHelpers.Internal.FileVersionProvider.AddFileVersionToPath(String path)
   at Microsoft.AspNetCore.Mvc.TagHelpers.ScriptTagHelper.Process(TagHelperContext context, TagHelperOutput output)
   at Microsoft.AspNetCore.Razor.TagHelpers.TagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.RunAsync(TagHelperExecutionContext executionContext)
   at Identity.DefaultUI.WebSite.Pages.Pages__Layout.<ExecuteAsync>b__46_14()
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()
   at Identity.DefaultUI.WebSite.Pages.Pages__Layout.<ExecuteAsync>b__46_1()
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()
   at Identity.DefaultUI.WebSite.Pages.Pages__Layout.ExecuteAsync()
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeResultAsync(IActionResult result)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResultFilterAsync[TFilter,TFilterAsync]()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResultExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeResultFilters()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.MigrationsEndPointMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.TestHost.HttpContextBuilder.<>c__DisplayClass10_0.<<SendAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.TestHost.ClientHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Mvc.Testing.Handlers.CookieContainerHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Microsoft.AspNetCore.Identity.FunctionalTests.Index.CreateAsync(HttpClient client, DefaultUIContext context)
   at Microsoft.AspNetCore.Identity.FunctionalTests.UserStories.RegisterNewUserAsync(HttpClient client, String userName, String password)
   at Microsoft.AspNetCore.Identity.FunctionalTests.LoginTests`2.CannotLogInWithoutRequiredEmailConfirmation_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 master.

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

CannotLogInWithoutRequiredEmailConfirmation_WithGlobalAuthorizeFilter failed with about the same error on 2.2. CannotLogInWithoutRequiredEmailConfirmation_WithGlobalAuthorizeFilter failed with about the same error on master. CannotLogInWithoutRequiredEmailConfirmation_WithGlobalAuthorizeFilter failed with about the same error on master. CanLogInAfterConfirmingEmail failed with about the same error on 2.2. CannotLogInWithoutRequiredEmailConfirmation_WithGlobalAuthorizeFilter failed with about the same error on master. CanLogInAfterConfirmingEmail 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

CanSetPasswordWithExternalLogin failed with about the same error on master. CanLogInAfterConfirmingEmail failed with about the same error on 2.2. CanLogInAfterConfirmingEmail failed with about the same error on master. CannotLogInWithoutRequiredEmailConfirmation_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

CannotLogInWithoutRequiredEmailConfirmation_WithGlobalAuthorizeFilter failed with about the same error on 2.2. CannotLogInWithoutRequiredEmailConfirmation_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

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 master. CannotLogInWithoutRequiredEmailConfirmation_WithGlobalAuthorizeFilter failed with about the same error on 2.2. 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

CannotLogInWithoutRequiredEmailConfirmation_WithGlobalAuthorizeFilter failed with about the same error on master. CannotLogInWithoutRequiredEmailConfirmation_WithGlobalAuthorizeFilter failed with about the same error on master. CannotLogInWithoutRequiredEmailConfirmation_WithGlobalAuthorizeFilter failed with about the same error on master. CanLogInWithTwoFactorAuthentication_WithGlobalAuthorizeFilter failed with about the same error on master. CanLogInAfterConfirmingEmail 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. CannotLogInWithoutRequiredEmailConfirmation_WithGlobalAuthorizeFilter failed with about the same error on master. CanLogInAfterConfirmingEmail 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

CanSetPasswordWithExternalLogin failed with about the same error on master. CannotLogInWithoutRequiredEmailConfirmation_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

CanLogInAfterConfirmingEmail failed with about the same error on master. CannotLogInWithoutRequiredEmailConfirmation_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.

Eilon commented 6 years ago

@HaoK - I looked around and unsurprisingly, FileSystemWatcher on its own doesn't really throw OOM errors, so presumably some other scarce system resources. Based on issues https://github.com/dotnet/corefx/issues/12435 and https://github.com/dotnet/corefx/issues/11622 it looks like this might have to do with just having too many simultaneous FileSystemWatcher instances.

Can we maybe limit the concurrency of tests in this repo to avoid these issues? Or something like that?

HaoK commented 6 years ago

Hopefully fixed/mitigated by https://github.com/aspnet/Identity/pull/1944