public void TestConcurrentSelect([IncludeDataSources(TestProvName.AllSqlServer2008Plus)] string context) { var dbFactory = MyDB.CreateFactory(context, 1, TimeSpan.FromSeconds(1)); var users = new[] { new User { Id = TestData.Guid1, Name = "User1" }, new User { Id = TestData.Guid2, Name = "User2" } }; // Ensures that concurrent async queries for multiple db instances are handled correctly using (var db = dbFactory()) using (db.CreateLocalTable(users)) { using (var db1 = dbFactory()) using (var db2 = dbFactory()) { var user1Task = db1.Users.FirstAsync(); var user2Task = db2.Users.FirstAsync(); Assert.DoesNotThrowAsync(() => Task.WhenAll(user1Task, user2Task)); Assert.IsNotNull(user1Task.Result); Assert.IsNotNull(user2Task.Result); } } }