diff --git a/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosDbContextOptionsBuilderExtensions.cs b/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosDbContextOptionsBuilderExtensions.cs index 6eb831b81f2..cf235a47f0d 100644 --- a/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosDbContextOptionsBuilderExtensions.cs +++ b/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosDbContextOptionsBuilderExtensions.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Net.Http; +using Microsoft.Azure.Cosmos; using Microsoft.EntityFrameworkCore.Infrastructure; namespace Microsoft.EntityFrameworkCore.TestUtilities @@ -10,8 +12,16 @@ public static class CosmosDbContextOptionsBuilderExtensions { public static CosmosDbContextOptionsBuilder ApplyConfiguration(this CosmosDbContextOptionsBuilder optionsBuilder) { - optionsBuilder.ExecutionStrategy(d => new TestCosmosExecutionStrategy(d)); - optionsBuilder.RequestTimeout(TimeSpan.FromMinutes(1)); + optionsBuilder + .ExecutionStrategy(d => new TestCosmosExecutionStrategy(d)) + .RequestTimeout(TimeSpan.FromMinutes(20)) + .HttpClientFactory( + () => new HttpClient( + new HttpClientHandler + { + ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator + })) + .ConnectionMode(ConnectionMode.Gateway); return optionsBuilder; } diff --git a/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs b/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs index 0714176da40..1bdbb0b6f4f 100644 --- a/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs +++ b/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs @@ -55,12 +55,12 @@ private CosmosTestStore( AuthToken = TestEnvironment.AuthToken; ConnectionString = TestEnvironment.ConnectionString; _configureCosmos = extensionConfiguration == null - ? (Action)(b => b.ApplyConfiguration()) - : (b => + ? b => b.ApplyConfiguration() + : b => { b.ApplyConfiguration(); extensionConfiguration(b); - }); + }; _storeContext = new TestStoreContext(this);