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

Azure DevOps: 690 test failures. Many Identity + SQL Server tests fail to connect to LocalDB #5812

Closed
natemcmaster opened this issue Jul 27, 2018 · 14 comments · Fixed by #10924
Assignees
Labels
area-identity Includes: Identity and providers Done This issue has been fixed

Comments

@natemcmaster
Copy link
Contributor

Something about the way the EF Core tests are configured does not work in the Hosted VS2017 agent pool. It seems most of the EF Core + SQL server tests are broken.

https://dotnet.visualstudio.com/public/_build/results?buildId=8559&view=ms.vss-test-web.test-result-details

System.Data.SqlClient.SqlException : Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=44133; handshake=39; 
---- System.ComponentModel.Win32Exception : The wait operation timed out.
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test.Utilities.SqlServerTestStore.DatabaseExists(String name) in /_/test/EF.Test/Utilities/SqlServerTestStore.cs:line 110
   at Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test.Utilities.SqlServerTestStore.GetScratchDbName() in /_/test/EF.Test/Utilities/SqlServerTestStore.cs:line 44
   at Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test.Utilities.SqlServerTestStore.CreateScratch(Boolean createDatabase) in /_/test/EF.Test/Utilities/SqlServerTestStore.cs:line 27
   at Microsoft.EntityFrameworkCore.Internal.LazyRef`1.get_Value()
   at Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test.ScratchDatabaseFixture.get_ConnectionString() in /_/test/EF.Test/Utilities/ScratchDatabaseFixture.cs:line 19
   at Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test.CustomPocoTest.CanCreateUserInt() in /_/test/EF.Test/CustomPocoTest.cs:line 100
--- End of stack trace from previous location where exception was thrown ---
----- Inner Stack Trace -----

cc @HaoK

@HaoK HaoK self-assigned this Jul 28, 2018
@Eilon
Copy link
Member

Eilon commented Jul 30, 2018

Tagging @ajcvickers here for FYI.

@HaoK
Copy link
Member

HaoK commented Aug 21, 2018

@ajcvickers so the identity queries typically all take the form of something like this:

Users.FirstOrDefaultAsync(u => u.NormalizedUserName == normalizedUserName, cancellationToken);

https://github.com/aspnet/Identity/blob/master/src/EF/UserStore.cs#L254

@natemcmaster natemcmaster changed the title VSTS: 690 test failures. Many Identity + SQL Server tests fail to connect to LocalDB Azure DevOps: 690 test failures. Many Identity + SQL Server tests fail to connect to LocalDB Sep 25, 2018
@natemcmaster
Copy link
Contributor Author

FYI I am disabling Identity PR validation for this repo since this issue is still unresolved.

@HaoK
Copy link
Member

HaoK commented Sep 25, 2018

@ajcvickers is there any update on the EF side for why async queries are failing on VSTS?

@ajcvickers
Copy link
Member

@HaoK There are some deadlock issues with the current query pipeline. The issues are pretty deep and won't realistically be fixed until 3.0. We still don't know 100% if this is the root cause of the test deadlocks, but we're working on the assumption that it is.

@aspnet-hello aspnet-hello transferred this issue from aspnet/Identity Dec 18, 2018
@aspnet-hello aspnet-hello assigned HaoK and unassigned HaoK Dec 18, 2018
@aspnet-hello aspnet-hello added area-identity Includes: Identity and providers Blocked! labels Dec 18, 2018
@Eilon Eilon added blocked The work on this issue is blocked due to some dependency and removed Blocked! labels Dec 20, 2018
@natemcmaster
Copy link
Contributor Author

Identity tests are still consistently failing in PR checks on this repo. In #6350, I'm going to completely disable Identity functional test projects while we sort this out.

@HaoK
Copy link
Member

HaoK commented Feb 19, 2019

@ajcvickers given that these tests are working fine on helix, do we care about the fact that these are disabled on AzDo anymore?

@natemcmaster
Copy link
Contributor Author

Don't forget that the tests also fail in 2.1 and 2.2 branches.

@ajcvickers
Copy link
Member

@HaoK I think we care until Helix is the thing we use everywhere.

@HaoK
Copy link
Member

HaoK commented Feb 22, 2019

Ok when is EF going to fix it? :)

@ajcvickers
Copy link
Member

That's not the question. It's when SQL Server is going to fix it. Which is never...so.

@HaoK
Copy link
Member

HaoK commented Feb 22, 2019

Which brings me back to my original question, are we planning on doing anything other than waiting for helix? I only ask because I was just looking over bugs assigned to me, and I wasn't sure there was anything actionable

@ajcvickers
Copy link
Member

There are some patterns that might help:

  • Spin up the connection to the database early so that LocalDb has a chance to start and get going before it is hammered
  • Make sure that connection resiliency is being used.
  • Potentially add additional test-level retries for when the database is not responding.

Or try running SQL Server on a different machine--this is what we plan to try with EF tests.

@natemcmaster
Copy link
Contributor Author

ajcvickers added a commit that referenced this issue Jun 5, 2019
Fixes #10671 by using updated EF API
Fixes #5812 so tests are re-enabled for PRs
Also part of #10668 since one of the changed EF queries is now working

Finally, I removed all remaining platform skips since with SQLite these tests should now run anywhere.
@ajcvickers ajcvickers added the Done This issue has been fixed label Jun 5, 2019
ajcvickers added a commit that referenced this issue Jun 5, 2019
Fixes #10671 by using updated EF API
Fixes #5812 so tests are re-enabled for PRs
Also part of #10668 since one of the changed EF queries is now working

Finally, I removed all remaining platform skips since with SQLite these tests should now run anywhere.
@ajcvickers ajcvickers added this to the 3.0.0-preview7 milestone Jun 5, 2019
@ajcvickers ajcvickers removed the blocked The work on this issue is blocked due to some dependency label Jun 5, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-identity Includes: Identity and providers Done This issue has been fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants