From 81c66979e42a49b17588755c1f763ab6b3523043 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Mon, 4 Dec 2023 10:43:05 +0100 Subject: [PATCH] Update to .NET 8 RTM (#2097) * update all dependencies that don't require TFM update to latest versions * build fix: fix xUnit1030 in the whole solution: don't use .GetAwaiter in Test projects * build fix: stop using UseBackgroundThreadsForIO, which got deprecated and removed (it was unused), see https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/846 for more details * build fix: xUnit1031: Test methods should not use blocking task operations, as they can cause deadlocks. * update all dependencies that required TFM bump to .NET 8 * build fix: stop using .Add, use .Append instead * run approval tests for 8, not 7 --- Directory.Build.props | 14 ++-- Directory.Build.targets | 2 +- .../HealthChecks.UI.Image.csproj | 6 +- .../HealthChecks.Sample.csproj | 2 +- .../HealthChecks.UI.Branding.csproj | 4 +- .../HealthChecks.UI.Oidc.csproj | 4 +- .../HealthChecks.UI.Sample.csproj | 2 +- .../HealthChecks.UI.StorageProviders.csproj | 2 +- .../HealthChecks.UIAndApi.csproj | 2 +- .../HealthChecks.UIAndApiCustomization.csproj | 2 +- .../HealthChecks.Aws.S3.csproj | 2 +- .../HealthChecks.Aws.SecretsManager.csproj | 2 +- .../HealthChecks.Aws.Sns.csproj | 2 +- .../HealthChecks.Aws.Sqs.csproj | 2 +- .../HealthChecks.Aws.SystemsManager.csproj | 2 +- .../HealthChecks.Azure.Data.Tables.csproj | 2 +- ...lthChecks.Azure.Messaging.EventHubs.csproj | 2 +- .../HealthChecks.Azure.Storage.Blobs.csproj | 2 +- ...thChecks.Azure.Storage.Files.Shares.csproj | 2 +- .../HealthChecks.Azure.Storage.Queues.csproj | 2 +- .../HealthChecks.AzureDigitalTwin.csproj | 2 +- .../HealthChecks.AzureSearch.csproj | 2 +- .../HealthChecks.AzureServiceBus.csproj | 2 +- .../HealthChecks.CosmosDb.csproj | 2 +- .../HealthChecks.Dapr.csproj | 2 +- .../HealthChecks.DynamoDb.csproj | 2 +- .../HealthChecks.Gcp.CloudFirestore.csproj | 2 +- .../HealthChecks.Hangfire.csproj | 2 +- .../HealthChecks.IbmMQ.csproj | 2 +- .../HealthChecks.InfluxDB.csproj | 2 +- .../HealthChecks.Kafka.csproj | 2 +- .../HealthChecks.Kubernetes.csproj | 2 +- .../HealthChecks.MongoDb.csproj | 2 +- .../HealthChecks.MySql.csproj | 2 +- .../HealthChecks.Nats.csproj | 2 +- .../HealthChecks.NpgSql.csproj | 4 +- .../HealthChecks.Oracle.csproj | 2 +- .../HealthChecks.Prometheus.Metrics.csproj | 2 +- .../HealthChecks.Publisher.CloudWatch.csproj | 2 +- .../HealthChecks.Publisher.Prometheus.csproj | 2 +- .../HealthChecks.Rabbitmq.csproj | 2 +- .../RabbitMQHealthCheck.cs | 3 +- .../HealthChecks.RavenDB.csproj | 2 +- .../HealthChecks.Redis.csproj | 2 +- .../HealthChecks.SignalR.csproj | 2 +- .../HealthChecks.UI.Data.csproj | 4 +- .../HealthChecks.UI.InMemory.Storage.csproj | 4 +- .../HealthChecks.UI.K8s.Operator.csproj | 4 +- .../HealthChecks.UI.MySql.Storage.csproj | 4 +- .../HealthChecks.UI.PostgreSQL.Storage.csproj | 4 +- .../HealthChecks.UI.SQLite.Storage.csproj | 4 +- .../HealthChecks.UI.SqlServer.Storage.csproj | 4 +- .../Core/UIEndpointsResourceMapper.cs | 2 +- src/HealthChecks.UI/Core/UIResourceMapper.cs | 2 +- src/HealthChecks.UI/HealthChecks.UI.csproj | 6 +- .../ApplicationStatusHealthCheckTests.cs | 4 +- .../Functional/ArangoDbHealthCheckTests.cs | 6 +- ...ealthChecks.Azure.Data.Tables.Tests.csproj | 2 +- .../TableServiceHealthCheckTests.cs | 19 ++--- ...Checks.Azure.KeyVault.Secrets.Tests.csproj | 2 +- ...cks.Azure.Messaging.EventHubs.Tests.csproj | 2 +- .../AzureBlobStorageHealthCheckTests.cs | 28 +++---- ...lthChecks.Azure.Storage.Blobs.Tests.csproj | 2 +- .../AzureFileShareHealthCheckTests.cs | 28 +++---- ...ks.Azure.Storage.Files.Shares.Tests.csproj | 2 +- .../AzureQueueStorageHealthCheckTests.cs | 28 +++---- ...thChecks.Azure.Storage.Queues.Tests.csproj | 2 +- ...HealthChecks.AzureDigitalTwin.Tests.csproj | 2 +- .../AzureKeyVaultHealthCheckTests.cs | 2 +- .../HealthChecks.AzureKeyVault.Tests.csproj | 2 +- .../AzureServiceBusQueueHealthCheckTests.cs | 65 +++++---------- ...ueMessageCountThresholdHealthCheckTests.cs | 48 ++++------- ...eServiceBusSubscriptionHealthCheckTests.cs | 65 +++++---------- .../AzureServiceBusTopicHealthCheckTests.cs | 48 ++++------- .../HealthChecks.AzureServiceBus.Tests.csproj | 2 +- .../Functional/ConsulHealthCheckTests.cs | 4 +- .../CosmosDbHealthCheckTests.cs | 83 +++++++------------ .../ElasticsearchAuthenticationTests.cs | 6 +- .../ElasticsearchHealthCheckTests.cs | 4 +- .../Functional/EventStoreHealthCheckTests.cs | 12 +-- .../Functional/EventStoreHealthCheckTests.cs | 6 +- .../Functional/GremlinHealthCheckTests.cs | 6 +- .../Functional/IbmMQHealthCheckTests.cs | 8 +- .../Functional/InfluxDBHealthCheckTests.cs | 4 +- .../Functional/KafkaHealthCheckTests.cs | 4 +- .../Functional/KubernetesHealthCheckTests.cs | 6 +- .../Functional/MongoDbHealthCheckTests.cs | 12 +-- .../Functional/MySqlHealthCheckTests.cs | 6 +- .../Functional/NatsHealthCheckTests.cs | 10 +-- .../Functional/DnsHealthCheckTests.cs | 4 +- .../DnsResolveCountHealthCheckTests.cs | 12 +-- .../Functional/FtpHealthCheckTests.cs | 6 +- .../Functional/ImapHealthCheckTests.cs | 20 ++--- .../Functional/PingHealthCheckTests.cs | 4 +- .../Functional/SftpHealthCheckTests.cs | 12 +-- .../Functional/SmtpHealthCheckTests.cs | 18 ++-- .../Functional/SslHealthCheckTests.cs | 14 ++-- .../Functional/TcpHealthCheckTests.cs | 2 +- .../HealthChecks.Network.Tests.csproj | 1 - .../Functional/NpgsqlHealthCheckTests.cs | 12 +-- .../Functional/IdSvrHealthCheckTests.cs | 4 +- .../Functional/OracleHealthCheckTests.cs | 16 ++-- .../PrometheusResponseWriterTests.cs | 12 +-- .../Functional/SeqPublisherTests.cs | 4 +- .../Functional/RabbitHealthCheckTests.cs | 22 ++--- .../Functional/RavenDbHealthCheckTests.cs | 22 ++--- ...bHealthCheckTestsSingleConnectionString.cs | 8 +- .../Functional/RedisHealthCheckTests.cs | 22 ++--- .../Functional/SignalRHealthCheckTests.cs | 4 +- .../Functional/SolrHealthCheckTests.cs | 12 +-- .../DependencyInjection/RegistrationTests.cs | 4 +- .../Functional/SqlServerHealthCheckTests.cs | 6 +- .../Functional/SqliteHealthCheckTests.cs | 6 +- .../Functional/DiskStorageHealthCheckTests.cs | 6 +- .../Functional/FolderHealthCheckTests.cs | 6 +- .../Functional/ProcessHealthChecksTests.cs | 6 +- .../HealthChecks.UI.Client.Tests.csproj | 4 + .../UIResponseWriterTests.cs | 8 +- .../HealthChecks.UI.Data.Tests.csproj | 6 +- .../HealthChecksDbTests.cs | 10 +-- .../Configuration/UIConfigurationTests.cs | 4 +- .../InMemoryStorageProviderTests.cs | 4 +- .../MySqlStorageProviderTests.cs | 4 +- .../PostgreSqlStorageProviderTests.cs | 4 +- .../SqlServerStorageProviderTests.cs | 4 +- .../SqliteStorageProviderTests.cs | 4 +- .../UpdateConfigurationTests.cs | 4 +- .../Functional/UIApiRequestLimitingTests.cs | 4 +- .../HealthChecks.UI.Tests.csproj | 2 +- .../Functional/UrisHealthCheckTests.cs | 28 +++---- .../Functional/UrisHealthcheckTests2.cs | 6 +- .../HealthChecks.Uris.Tests.csproj | 6 +- test/_SHARED/ApiApprovalTests.cs | 1 + test/_SHARED/ConformanceTests.cs | 2 +- 134 files changed, 471 insertions(+), 580 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 9e63a61d82..c7e86c6ab1 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -22,7 +22,7 @@ true enable HealthCheck;HealthChecks;Health - $(NoWarn);1591;IDISP013 + $(NoWarn);1591;IDISP013;AD0001; false true README.md @@ -35,7 +35,7 @@ net6.0;net7.0;net8.0 - $(NoWarn);IDE1006 + $(NoWarn);IDE1006;RCS1090 $(WarningsNotAsErrors);IDE0053;IDE0060 @@ -55,10 +55,10 @@ - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive @@ -67,7 +67,7 @@ - + diff --git a/Directory.Build.targets b/Directory.Build.targets index 12b946ef6e..07841030dd 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -2,7 +2,7 @@ - + diff --git a/build/docker-images/HealthChecks.UI.Image/HealthChecks.UI.Image.csproj b/build/docker-images/HealthChecks.UI.Image/HealthChecks.UI.Image.csproj index 93d15d4e44..710ae6fb6e 100644 --- a/build/docker-images/HealthChecks.UI.Image/HealthChecks.UI.Image.csproj +++ b/build/docker-images/HealthChecks.UI.Image/HealthChecks.UI.Image.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 $(WarningsNotAsErrors);RCS1090 @@ -11,8 +11,8 @@ - - + + diff --git a/samples/HealthChecks.Sample/HealthChecks.Sample.csproj b/samples/HealthChecks.Sample/HealthChecks.Sample.csproj index a483e8c2bd..9c8d42a83e 100644 --- a/samples/HealthChecks.Sample/HealthChecks.Sample.csproj +++ b/samples/HealthChecks.Sample/HealthChecks.Sample.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 diff --git a/samples/HealthChecks.UI.Branding/HealthChecks.UI.Branding.csproj b/samples/HealthChecks.UI.Branding/HealthChecks.UI.Branding.csproj index 2aaa64a645..fa8a63a366 100644 --- a/samples/HealthChecks.UI.Branding/HealthChecks.UI.Branding.csproj +++ b/samples/HealthChecks.UI.Branding/HealthChecks.UI.Branding.csproj @@ -1,11 +1,11 @@ - net7.0 + net8.0 - + diff --git a/samples/HealthChecks.UI.Oidc/HealthChecks.UI.Oidc.csproj b/samples/HealthChecks.UI.Oidc/HealthChecks.UI.Oidc.csproj index 954f1ab106..5ea30f044a 100644 --- a/samples/HealthChecks.UI.Oidc/HealthChecks.UI.Oidc.csproj +++ b/samples/HealthChecks.UI.Oidc/HealthChecks.UI.Oidc.csproj @@ -1,11 +1,11 @@ - net7.0 + net8.0 - + diff --git a/samples/HealthChecks.UI.Sample/HealthChecks.UI.Sample.csproj b/samples/HealthChecks.UI.Sample/HealthChecks.UI.Sample.csproj index 37b3b472cc..4d2541e862 100644 --- a/samples/HealthChecks.UI.Sample/HealthChecks.UI.Sample.csproj +++ b/samples/HealthChecks.UI.Sample/HealthChecks.UI.Sample.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 InProcess diff --git a/samples/HealthChecks.UI.StorageProviders/HealthChecks.UI.StorageProviders.csproj b/samples/HealthChecks.UI.StorageProviders/HealthChecks.UI.StorageProviders.csproj index 3845a5521a..f1a93069a3 100644 --- a/samples/HealthChecks.UI.StorageProviders/HealthChecks.UI.StorageProviders.csproj +++ b/samples/HealthChecks.UI.StorageProviders/HealthChecks.UI.StorageProviders.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 diff --git a/samples/HealthChecks.UIAndApi/HealthChecks.UIAndApi.csproj b/samples/HealthChecks.UIAndApi/HealthChecks.UIAndApi.csproj index 98e23f136a..0cb0c0ff50 100644 --- a/samples/HealthChecks.UIAndApi/HealthChecks.UIAndApi.csproj +++ b/samples/HealthChecks.UIAndApi/HealthChecks.UIAndApi.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 InProcess diff --git a/samples/HealthChecks.UIAndApiCustomization/HealthChecks.UIAndApiCustomization.csproj b/samples/HealthChecks.UIAndApiCustomization/HealthChecks.UIAndApiCustomization.csproj index 9f8b2ddae8..1aa3a6909b 100644 --- a/samples/HealthChecks.UIAndApiCustomization/HealthChecks.UIAndApiCustomization.csproj +++ b/samples/HealthChecks.UIAndApiCustomization/HealthChecks.UIAndApiCustomization.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 InProcess diff --git a/src/HealthChecks.Aws.S3/HealthChecks.Aws.S3.csproj b/src/HealthChecks.Aws.S3/HealthChecks.Aws.S3.csproj index 71b658cf69..175ab0e901 100644 --- a/src/HealthChecks.Aws.S3/HealthChecks.Aws.S3.csproj +++ b/src/HealthChecks.Aws.S3/HealthChecks.Aws.S3.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.Aws.SecretsManager/HealthChecks.Aws.SecretsManager.csproj b/src/HealthChecks.Aws.SecretsManager/HealthChecks.Aws.SecretsManager.csproj index 1211250a13..39dab65586 100644 --- a/src/HealthChecks.Aws.SecretsManager/HealthChecks.Aws.SecretsManager.csproj +++ b/src/HealthChecks.Aws.SecretsManager/HealthChecks.Aws.SecretsManager.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.Aws.Sns/HealthChecks.Aws.Sns.csproj b/src/HealthChecks.Aws.Sns/HealthChecks.Aws.Sns.csproj index 763312be90..9b82fdc98c 100644 --- a/src/HealthChecks.Aws.Sns/HealthChecks.Aws.Sns.csproj +++ b/src/HealthChecks.Aws.Sns/HealthChecks.Aws.Sns.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.Aws.Sqs/HealthChecks.Aws.Sqs.csproj b/src/HealthChecks.Aws.Sqs/HealthChecks.Aws.Sqs.csproj index fc8e5690f4..fedf4b934b 100644 --- a/src/HealthChecks.Aws.Sqs/HealthChecks.Aws.Sqs.csproj +++ b/src/HealthChecks.Aws.Sqs/HealthChecks.Aws.Sqs.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.Aws.SystemsManager/HealthChecks.Aws.SystemsManager.csproj b/src/HealthChecks.Aws.SystemsManager/HealthChecks.Aws.SystemsManager.csproj index d055578374..8fc9040865 100644 --- a/src/HealthChecks.Aws.SystemsManager/HealthChecks.Aws.SystemsManager.csproj +++ b/src/HealthChecks.Aws.SystemsManager/HealthChecks.Aws.SystemsManager.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.Azure.Data.Tables/HealthChecks.Azure.Data.Tables.csproj b/src/HealthChecks.Azure.Data.Tables/HealthChecks.Azure.Data.Tables.csproj index 6020a9bd74..a76c70899a 100644 --- a/src/HealthChecks.Azure.Data.Tables/HealthChecks.Azure.Data.Tables.csproj +++ b/src/HealthChecks.Azure.Data.Tables/HealthChecks.Azure.Data.Tables.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/HealthChecks.Azure.Messaging.EventHubs/HealthChecks.Azure.Messaging.EventHubs.csproj b/src/HealthChecks.Azure.Messaging.EventHubs/HealthChecks.Azure.Messaging.EventHubs.csproj index 694308ffd7..b64cf916ae 100644 --- a/src/HealthChecks.Azure.Messaging.EventHubs/HealthChecks.Azure.Messaging.EventHubs.csproj +++ b/src/HealthChecks.Azure.Messaging.EventHubs/HealthChecks.Azure.Messaging.EventHubs.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.Azure.Storage.Blobs/HealthChecks.Azure.Storage.Blobs.csproj b/src/HealthChecks.Azure.Storage.Blobs/HealthChecks.Azure.Storage.Blobs.csproj index 5dfab9f7c0..2aebac0a79 100644 --- a/src/HealthChecks.Azure.Storage.Blobs/HealthChecks.Azure.Storage.Blobs.csproj +++ b/src/HealthChecks.Azure.Storage.Blobs/HealthChecks.Azure.Storage.Blobs.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.Azure.Storage.Files.Shares/HealthChecks.Azure.Storage.Files.Shares.csproj b/src/HealthChecks.Azure.Storage.Files.Shares/HealthChecks.Azure.Storage.Files.Shares.csproj index ec00b056f2..8e7d245573 100644 --- a/src/HealthChecks.Azure.Storage.Files.Shares/HealthChecks.Azure.Storage.Files.Shares.csproj +++ b/src/HealthChecks.Azure.Storage.Files.Shares/HealthChecks.Azure.Storage.Files.Shares.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.Azure.Storage.Queues/HealthChecks.Azure.Storage.Queues.csproj b/src/HealthChecks.Azure.Storage.Queues/HealthChecks.Azure.Storage.Queues.csproj index 7751f3815b..286c7cf785 100644 --- a/src/HealthChecks.Azure.Storage.Queues/HealthChecks.Azure.Storage.Queues.csproj +++ b/src/HealthChecks.Azure.Storage.Queues/HealthChecks.Azure.Storage.Queues.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.AzureDigitalTwin/HealthChecks.AzureDigitalTwin.csproj b/src/HealthChecks.AzureDigitalTwin/HealthChecks.AzureDigitalTwin.csproj index c30e59e013..d4a06d893d 100644 --- a/src/HealthChecks.AzureDigitalTwin/HealthChecks.AzureDigitalTwin.csproj +++ b/src/HealthChecks.AzureDigitalTwin/HealthChecks.AzureDigitalTwin.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.AzureSearch/HealthChecks.AzureSearch.csproj b/src/HealthChecks.AzureSearch/HealthChecks.AzureSearch.csproj index 01a725c903..45755c1748 100644 --- a/src/HealthChecks.AzureSearch/HealthChecks.AzureSearch.csproj +++ b/src/HealthChecks.AzureSearch/HealthChecks.AzureSearch.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.AzureServiceBus/HealthChecks.AzureServiceBus.csproj b/src/HealthChecks.AzureServiceBus/HealthChecks.AzureServiceBus.csproj index e5d39cf0b2..631b643c84 100644 --- a/src/HealthChecks.AzureServiceBus/HealthChecks.AzureServiceBus.csproj +++ b/src/HealthChecks.AzureServiceBus/HealthChecks.AzureServiceBus.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.CosmosDb/HealthChecks.CosmosDb.csproj b/src/HealthChecks.CosmosDb/HealthChecks.CosmosDb.csproj index 5246c89027..b96118612d 100644 --- a/src/HealthChecks.CosmosDb/HealthChecks.CosmosDb.csproj +++ b/src/HealthChecks.CosmosDb/HealthChecks.CosmosDb.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.Dapr/HealthChecks.Dapr.csproj b/src/HealthChecks.Dapr/HealthChecks.Dapr.csproj index 2933e91871..c13f287872 100644 --- a/src/HealthChecks.Dapr/HealthChecks.Dapr.csproj +++ b/src/HealthChecks.Dapr/HealthChecks.Dapr.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/HealthChecks.DynamoDb/HealthChecks.DynamoDb.csproj b/src/HealthChecks.DynamoDb/HealthChecks.DynamoDb.csproj index 611f357ff9..4bd09a5afb 100644 --- a/src/HealthChecks.DynamoDb/HealthChecks.DynamoDb.csproj +++ b/src/HealthChecks.DynamoDb/HealthChecks.DynamoDb.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.Gcp.CloudFirestore/HealthChecks.Gcp.CloudFirestore.csproj b/src/HealthChecks.Gcp.CloudFirestore/HealthChecks.Gcp.CloudFirestore.csproj index c9cad30314..b332d41c69 100644 --- a/src/HealthChecks.Gcp.CloudFirestore/HealthChecks.Gcp.CloudFirestore.csproj +++ b/src/HealthChecks.Gcp.CloudFirestore/HealthChecks.Gcp.CloudFirestore.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/HealthChecks.Hangfire/HealthChecks.Hangfire.csproj b/src/HealthChecks.Hangfire/HealthChecks.Hangfire.csproj index 3460695832..64cd5e0590 100644 --- a/src/HealthChecks.Hangfire/HealthChecks.Hangfire.csproj +++ b/src/HealthChecks.Hangfire/HealthChecks.Hangfire.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/HealthChecks.IbmMQ/HealthChecks.IbmMQ.csproj b/src/HealthChecks.IbmMQ/HealthChecks.IbmMQ.csproj index d6e13ae0df..b4b7427870 100644 --- a/src/HealthChecks.IbmMQ/HealthChecks.IbmMQ.csproj +++ b/src/HealthChecks.IbmMQ/HealthChecks.IbmMQ.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj b/src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj index 5d8eab26be..b4888b7ce2 100644 --- a/src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj +++ b/src/HealthChecks.InfluxDB/HealthChecks.InfluxDB.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.Kafka/HealthChecks.Kafka.csproj b/src/HealthChecks.Kafka/HealthChecks.Kafka.csproj index ae6dc67323..0295031359 100644 --- a/src/HealthChecks.Kafka/HealthChecks.Kafka.csproj +++ b/src/HealthChecks.Kafka/HealthChecks.Kafka.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.Kubernetes/HealthChecks.Kubernetes.csproj b/src/HealthChecks.Kubernetes/HealthChecks.Kubernetes.csproj index ad33176eff..6692ebfa47 100644 --- a/src/HealthChecks.Kubernetes/HealthChecks.Kubernetes.csproj +++ b/src/HealthChecks.Kubernetes/HealthChecks.Kubernetes.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/HealthChecks.MongoDb/HealthChecks.MongoDb.csproj b/src/HealthChecks.MongoDb/HealthChecks.MongoDb.csproj index f8721fcf3a..10520df106 100644 --- a/src/HealthChecks.MongoDb/HealthChecks.MongoDb.csproj +++ b/src/HealthChecks.MongoDb/HealthChecks.MongoDb.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/HealthChecks.MySql/HealthChecks.MySql.csproj b/src/HealthChecks.MySql/HealthChecks.MySql.csproj index 6a99203d9e..04c87fd401 100644 --- a/src/HealthChecks.MySql/HealthChecks.MySql.csproj +++ b/src/HealthChecks.MySql/HealthChecks.MySql.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.Nats/HealthChecks.Nats.csproj b/src/HealthChecks.Nats/HealthChecks.Nats.csproj index 84853351bc..5ef1c8d7ed 100644 --- a/src/HealthChecks.Nats/HealthChecks.Nats.csproj +++ b/src/HealthChecks.Nats/HealthChecks.Nats.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/HealthChecks.NpgSql/HealthChecks.NpgSql.csproj b/src/HealthChecks.NpgSql/HealthChecks.NpgSql.csproj index 3fed4539c1..785236dcb3 100644 --- a/src/HealthChecks.NpgSql/HealthChecks.NpgSql.csproj +++ b/src/HealthChecks.NpgSql/HealthChecks.NpgSql.csproj @@ -1,14 +1,14 @@ - netstandard2.0;net7.0 + netstandard2.0;net7.0;net8.0 $(PackageTags);Beat;Postgress HealthChecks.NpgSql is a health check for Postgress Sql. $(HealthCheckNpgSql) - + diff --git a/src/HealthChecks.Oracle/HealthChecks.Oracle.csproj b/src/HealthChecks.Oracle/HealthChecks.Oracle.csproj index c3890f714e..a3128ad6f1 100644 --- a/src/HealthChecks.Oracle/HealthChecks.Oracle.csproj +++ b/src/HealthChecks.Oracle/HealthChecks.Oracle.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/HealthChecks.Prometheus.Metrics/HealthChecks.Prometheus.Metrics.csproj b/src/HealthChecks.Prometheus.Metrics/HealthChecks.Prometheus.Metrics.csproj index f73f636f94..a8fe54d350 100644 --- a/src/HealthChecks.Prometheus.Metrics/HealthChecks.Prometheus.Metrics.csproj +++ b/src/HealthChecks.Prometheus.Metrics/HealthChecks.Prometheus.Metrics.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/HealthChecks.Publisher.CloudWatch/HealthChecks.Publisher.CloudWatch.csproj b/src/HealthChecks.Publisher.CloudWatch/HealthChecks.Publisher.CloudWatch.csproj index 8c9b525bb6..c7d7f2032d 100644 --- a/src/HealthChecks.Publisher.CloudWatch/HealthChecks.Publisher.CloudWatch.csproj +++ b/src/HealthChecks.Publisher.CloudWatch/HealthChecks.Publisher.CloudWatch.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.Publisher.Prometheus/HealthChecks.Publisher.Prometheus.csproj b/src/HealthChecks.Publisher.Prometheus/HealthChecks.Publisher.Prometheus.csproj index 94986f822a..c215192b87 100644 --- a/src/HealthChecks.Publisher.Prometheus/HealthChecks.Publisher.Prometheus.csproj +++ b/src/HealthChecks.Publisher.Prometheus/HealthChecks.Publisher.Prometheus.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/HealthChecks.Rabbitmq/HealthChecks.Rabbitmq.csproj b/src/HealthChecks.Rabbitmq/HealthChecks.Rabbitmq.csproj index 347e86e4c5..28faa3a51c 100644 --- a/src/HealthChecks.Rabbitmq/HealthChecks.Rabbitmq.csproj +++ b/src/HealthChecks.Rabbitmq/HealthChecks.Rabbitmq.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/HealthChecks.Rabbitmq/RabbitMQHealthCheck.cs b/src/HealthChecks.Rabbitmq/RabbitMQHealthCheck.cs index f59ba51888..570cb71b61 100644 --- a/src/HealthChecks.Rabbitmq/RabbitMQHealthCheck.cs +++ b/src/HealthChecks.Rabbitmq/RabbitMQHealthCheck.cs @@ -52,8 +52,7 @@ private IConnection EnsureConnection() factory = new ConnectionFactory { Uri = _options.ConnectionUri, - AutomaticRecoveryEnabled = true, - UseBackgroundThreadsForIO = true + AutomaticRecoveryEnabled = true }; if (_options.RequestedConnectionTimeout is not null) diff --git a/src/HealthChecks.RavenDB/HealthChecks.RavenDB.csproj b/src/HealthChecks.RavenDB/HealthChecks.RavenDB.csproj index f969078363..4711c9ff76 100644 --- a/src/HealthChecks.RavenDB/HealthChecks.RavenDB.csproj +++ b/src/HealthChecks.RavenDB/HealthChecks.RavenDB.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/HealthChecks.Redis/HealthChecks.Redis.csproj b/src/HealthChecks.Redis/HealthChecks.Redis.csproj index 8127d1df22..1b47c0eccb 100644 --- a/src/HealthChecks.Redis/HealthChecks.Redis.csproj +++ b/src/HealthChecks.Redis/HealthChecks.Redis.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.SignalR/HealthChecks.SignalR.csproj b/src/HealthChecks.SignalR/HealthChecks.SignalR.csproj index 22cf6cb416..e001a97e3c 100644 --- a/src/HealthChecks.SignalR/HealthChecks.SignalR.csproj +++ b/src/HealthChecks.SignalR/HealthChecks.SignalR.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HealthChecks.UI.Data/HealthChecks.UI.Data.csproj b/src/HealthChecks.UI.Data/HealthChecks.UI.Data.csproj index b71b0cb5a1..61996ecdf7 100644 --- a/src/HealthChecks.UI.Data/HealthChecks.UI.Data.csproj +++ b/src/HealthChecks.UI.Data/HealthChecks.UI.Data.csproj @@ -1,14 +1,14 @@ - net6.0 + net8.0 $(PackageTags);Data HealthChecks.UI.Data package containing data models and database context definition $(HealthCheckUIData) - + diff --git a/src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj b/src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj index e3b60b74a8..6b9b5f2724 100644 --- a/src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj +++ b/src/HealthChecks.UI.InMemory.Storage/HealthChecks.UI.InMemory.Storage.csproj @@ -1,14 +1,14 @@ - net6.0 + net8.0 $(PackageTags);InMemory HealthChecks.UI.InMemory.Storage package contains the required classes to use InMemory provider in the UI $(HealthCheckUIInMemoryStorage) - + diff --git a/src/HealthChecks.UI.K8s.Operator/HealthChecks.UI.K8s.Operator.csproj b/src/HealthChecks.UI.K8s.Operator/HealthChecks.UI.K8s.Operator.csproj index d9df6a8ebe..41fc8d3aff 100644 --- a/src/HealthChecks.UI.K8s.Operator/HealthChecks.UI.K8s.Operator.csproj +++ b/src/HealthChecks.UI.K8s.Operator/HealthChecks.UI.K8s.Operator.csproj @@ -11,10 +11,10 @@ - + - + diff --git a/src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj b/src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj index 75895b4c26..de18713876 100644 --- a/src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj +++ b/src/HealthChecks.UI.MySql.Storage/HealthChecks.UI.MySql.Storage.csproj @@ -1,14 +1,14 @@ - net6.0 + net8.0 $(PackageTags);MySql HealthChecks.UI.MySql.Storage package contains the required classes to use the MySQL database provider in the UI $(HealthCheckUIMySqlStorage) - + diff --git a/src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj b/src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj index a3ec6443dd..2950416dfb 100644 --- a/src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj +++ b/src/HealthChecks.UI.PostgreSQL.Storage/HealthChecks.UI.PostgreSQL.Storage.csproj @@ -1,14 +1,14 @@ - net6.0 + net8.0 $(PackageTags);PostgreSQL HealthChecks.UI.PostgreSQL.Storage package contains the required classes to use Postgres NpgSql provider in the UI $(HealthChecksUIPostgreSQLStorage) - + diff --git a/src/HealthChecks.UI.SQLite.Storage/HealthChecks.UI.SQLite.Storage.csproj b/src/HealthChecks.UI.SQLite.Storage/HealthChecks.UI.SQLite.Storage.csproj index 0f61b522b8..9295f34b74 100644 --- a/src/HealthChecks.UI.SQLite.Storage/HealthChecks.UI.SQLite.Storage.csproj +++ b/src/HealthChecks.UI.SQLite.Storage/HealthChecks.UI.SQLite.Storage.csproj @@ -1,14 +1,14 @@ - net6.0 + net8.0 $(PackageTags);SQLite HealthChecks.UI.SQLite.Storage package contains the required classes to use SQLite provider in the UI $(HealthCheckUISQLiteStorage) - + diff --git a/src/HealthChecks.UI.SqlServer.Storage/HealthChecks.UI.SqlServer.Storage.csproj b/src/HealthChecks.UI.SqlServer.Storage/HealthChecks.UI.SqlServer.Storage.csproj index b5fa42da87..35e5d2a817 100644 --- a/src/HealthChecks.UI.SqlServer.Storage/HealthChecks.UI.SqlServer.Storage.csproj +++ b/src/HealthChecks.UI.SqlServer.Storage/HealthChecks.UI.SqlServer.Storage.csproj @@ -1,14 +1,14 @@ - net6.0 + net8.0 $(PackageTags);SqlServer HealthChecks.UI.SqlServer.Storage package contains the required classes to use SqlServer provider in the UI $(HealthCheckUISqlServerStorage) - + diff --git a/src/HealthChecks.UI/Core/UIEndpointsResourceMapper.cs b/src/HealthChecks.UI/Core/UIEndpointsResourceMapper.cs index f13e263fd9..75a86da89a 100644 --- a/src/HealthChecks.UI/Core/UIEndpointsResourceMapper.cs +++ b/src/HealthChecks.UI/Core/UIEndpointsResourceMapper.cs @@ -37,7 +37,7 @@ public IEnumerable Map(IEndpointRouteBuilder builder { if (!context.Response.Headers.ContainsKey("Cache-Control")) { - context.Response.Headers.Add("Cache-Control", "no-cache, no-store"); + context.Response.Headers.Append("Cache-Control", "no-cache, no-store"); } return Task.CompletedTask; diff --git a/src/HealthChecks.UI/Core/UIResourceMapper.cs b/src/HealthChecks.UI/Core/UIResourceMapper.cs index ceaf961664..9bc109281b 100644 --- a/src/HealthChecks.UI/Core/UIResourceMapper.cs +++ b/src/HealthChecks.UI/Core/UIResourceMapper.cs @@ -42,7 +42,7 @@ public void Map(IApplicationBuilder app, Options options) if (!context.Response.Headers.ContainsKey("Cache-Control")) { - context.Response.Headers.Add("Cache-Control", "no-cache, no-store"); + context.Response.Headers.Append("Cache-Control", "no-cache, no-store"); } return Task.CompletedTask; diff --git a/src/HealthChecks.UI/HealthChecks.UI.csproj b/src/HealthChecks.UI/HealthChecks.UI.csproj index 0d2d7120b3..1baf5a9224 100644 --- a/src/HealthChecks.UI/HealthChecks.UI.csproj +++ b/src/HealthChecks.UI/HealthChecks.UI.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 $(PackageTags);UI HealthChecks.UI is a ASP.NET Core UI viewer of ASP.NET Core HealthChecks. For more information see https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks $(HealthCheckUI) @@ -20,8 +20,8 @@ - - + + diff --git a/test/HealthChecks.ApplicationStatus.Tests/Functional/ApplicationStatusHealthCheckTests.cs b/test/HealthChecks.ApplicationStatus.Tests/Functional/ApplicationStatusHealthCheckTests.cs index 036a574b19..bdfdfd09a9 100644 --- a/test/HealthChecks.ApplicationStatus.Tests/Functional/ApplicationStatusHealthCheckTests.cs +++ b/test/HealthChecks.ApplicationStatus.Tests/Functional/ApplicationStatusHealthCheckTests.cs @@ -6,7 +6,7 @@ public class applicationstatus_healthcheck_should public async Task be_healthy_if_application_is_not_stopped() { using var sut = new ApplicationStatusHealthCheck(new TestHostApplicationLifeTime()); - var result = await sut.CheckHealthAsync(new HealthCheckContext()).ConfigureAwait(false); + var result = await sut.CheckHealthAsync(new HealthCheckContext()); result.ShouldBe(HealthCheckResult.Healthy()); } @@ -17,7 +17,7 @@ public async Task be_unhealthy_if_application_is_stopped() using var sut = new ApplicationStatusHealthCheck(lifetime); lifetime.StopApplication(); - var result = await sut.CheckHealthAsync(new HealthCheckContext()).ConfigureAwait(false); + var result = await sut.CheckHealthAsync(new HealthCheckContext()); result.ShouldBe(HealthCheckResult.Unhealthy()); } diff --git a/test/HealthChecks.ArangoDb.Tests/Functional/ArangoDbHealthCheckTests.cs b/test/HealthChecks.ArangoDb.Tests/Functional/ArangoDbHealthCheckTests.cs index 7891029537..728dbdde72 100644 --- a/test/HealthChecks.ArangoDb.Tests/Functional/ArangoDbHealthCheckTests.cs +++ b/test/HealthChecks.ArangoDb.Tests/Functional/ArangoDbHealthCheckTests.cs @@ -29,7 +29,7 @@ public async Task be_healthy_if_arangodb_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -67,7 +67,7 @@ public async Task be_healthy_if_multiple_arango_are_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -97,7 +97,7 @@ public async Task be_unhealthy_if_arango_is_not_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.Azure.Data.Tables.Tests/HealthChecks.Azure.Data.Tables.Tests.csproj b/test/HealthChecks.Azure.Data.Tables.Tests/HealthChecks.Azure.Data.Tables.Tests.csproj index 9c064f3b7e..5b880431ac 100644 --- a/test/HealthChecks.Azure.Data.Tables.Tests/HealthChecks.Azure.Data.Tables.Tests.csproj +++ b/test/HealthChecks.Azure.Data.Tables.Tests/HealthChecks.Azure.Data.Tables.Tests.csproj @@ -1,7 +1,7 @@ - + diff --git a/test/HealthChecks.Azure.Data.Tables.Tests/TableServiceHealthCheckTests.cs b/test/HealthChecks.Azure.Data.Tables.Tests/TableServiceHealthCheckTests.cs index 363ff2584e..6606790eb3 100644 --- a/test/HealthChecks.Azure.Data.Tables.Tests/TableServiceHealthCheckTests.cs +++ b/test/HealthChecks.Azure.Data.Tables.Tests/TableServiceHealthCheckTests.cs @@ -41,7 +41,7 @@ public async Task return_healthy_when_only_checking_healthy_service() .QueryAsync(filter: "false", cancellationToken: tokenSource.Token) .Returns(AsyncPageable.FromPages(Array.Empty>())); - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _tableServiceClient .Received(1) @@ -68,7 +68,7 @@ public async Task return_healthy_when_checking_healthy_service_and_table() .Returns(AsyncPageable.FromPages(Array.Empty>())); _options.TableName = TableName; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _tableServiceClient .Received(1) @@ -104,7 +104,7 @@ public async Task return_unhealthy_when_checking_unhealthy_service(bool checkTab .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.Unauthorized, "Unable to authorize access.")); _options.TableName = checkTable ? TableName : null; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _tableServiceClient .Received(1) @@ -116,8 +116,7 @@ public async Task return_unhealthy_when_checking_unhealthy_service(bool checkTab await enumerator .Received(1) - .MoveNextAsync() - .ConfigureAwait(false); + .MoveNextAsync(); _tableClient .DidNotReceiveWithAnyArgs() @@ -154,7 +153,7 @@ public async Task return_unhealthy_when_checking_unhealthy_container() .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Table not found")); _options.TableName = TableName; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _tableServiceClient .Received(1) @@ -170,8 +169,7 @@ public async Task return_unhealthy_when_checking_unhealthy_container() await enumerator .Received(1) - .MoveNextAsync() - .ConfigureAwait(false); + .MoveNextAsync(); actual.Status.ShouldBe(HealthStatus.Unhealthy); actual @@ -210,7 +208,7 @@ public async Task return_unhealthy_when_invoked_from_healthcheckservice() .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Table not found")); var service = provider.GetRequiredService(); - var report = await service.CheckHealthAsync().ConfigureAwait(false); + var report = await service.CheckHealthAsync(); _tableServiceClient .Received(1) @@ -226,8 +224,7 @@ public async Task return_unhealthy_when_invoked_from_healthcheckservice() await enumerator .Received(1) - .MoveNextAsync() - .ConfigureAwait(false); + .MoveNextAsync(); var actual = report.Entries[HealthCheckName]; actual.Status.ShouldBe(HealthStatus.Unhealthy); diff --git a/test/HealthChecks.Azure.KeyVault.Secrets.Tests/HealthChecks.Azure.KeyVault.Secrets.Tests.csproj b/test/HealthChecks.Azure.KeyVault.Secrets.Tests/HealthChecks.Azure.KeyVault.Secrets.Tests.csproj index 9d7c788944..d9edfb9d06 100644 --- a/test/HealthChecks.Azure.KeyVault.Secrets.Tests/HealthChecks.Azure.KeyVault.Secrets.Tests.csproj +++ b/test/HealthChecks.Azure.KeyVault.Secrets.Tests/HealthChecks.Azure.KeyVault.Secrets.Tests.csproj @@ -1,7 +1,7 @@ - + diff --git a/test/HealthChecks.Azure.Messaging.EventHubs.Tests/HealthChecks.Azure.Messaging.EventHubs.Tests.csproj b/test/HealthChecks.Azure.Messaging.EventHubs.Tests/HealthChecks.Azure.Messaging.EventHubs.Tests.csproj index 7a75f200e1..905a48af3c 100644 --- a/test/HealthChecks.Azure.Messaging.EventHubs.Tests/HealthChecks.Azure.Messaging.EventHubs.Tests.csproj +++ b/test/HealthChecks.Azure.Messaging.EventHubs.Tests/HealthChecks.Azure.Messaging.EventHubs.Tests.csproj @@ -1,7 +1,7 @@ - + diff --git a/test/HealthChecks.Azure.Storage.Blobs.Tests/AzureBlobStorageHealthCheckTests.cs b/test/HealthChecks.Azure.Storage.Blobs.Tests/AzureBlobStorageHealthCheckTests.cs index 6a44753f26..d18ad18061 100644 --- a/test/HealthChecks.Azure.Storage.Blobs.Tests/AzureBlobStorageHealthCheckTests.cs +++ b/test/HealthChecks.Azure.Storage.Blobs.Tests/AzureBlobStorageHealthCheckTests.cs @@ -41,7 +41,7 @@ public async Task return_healthy_when_only_checking_healthy_service() .GetBlobContainersAsync(cancellationToken: tokenSource.Token) .Returns(AsyncPageable.FromPages(Array.Empty>())); - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _blobServiceClient .Received(1) @@ -49,8 +49,7 @@ public async Task return_healthy_when_only_checking_healthy_service() await _blobContainerClient .DidNotReceiveWithAnyArgs() - .GetPropertiesAsync(default, default) - .ConfigureAwait(false); + .GetPropertiesAsync(default, default); actual.Status.ShouldBe(HealthStatus.Healthy); } @@ -69,7 +68,7 @@ public async Task return_healthy_when_checking_healthy_service_and_container() .Returns(Substitute.For>()); _options.ContainerName = ContainerName; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _blobServiceClient .Received(1) @@ -77,8 +76,7 @@ public async Task return_healthy_when_checking_healthy_service_and_container() await _blobContainerClient .Received(1) - .GetPropertiesAsync(conditions: null, cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .GetPropertiesAsync(conditions: null, cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Healthy); } @@ -111,7 +109,7 @@ public async Task return_unhealthy_when_checking_unhealthy_service(bool checkCon .Returns(pageable); _options.ContainerName = checkContainer ? ContainerName : null; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _blobServiceClient .Received(1) @@ -127,13 +125,11 @@ public async Task return_unhealthy_when_checking_unhealthy_service(bool checkCon await enumerator .Received(1) - .MoveNextAsync() - .ConfigureAwait(false); + .MoveNextAsync(); await _blobContainerClient .DidNotReceiveWithAnyArgs() - .GetPropertiesAsync(default, default) - .ConfigureAwait(false); + .GetPropertiesAsync(default, default); actual.Status.ShouldBe(HealthStatus.Unhealthy); actual @@ -155,7 +151,7 @@ public async Task return_unhealthy_when_checking_unhealthy_container() .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Container not found")); _options.ContainerName = ContainerName; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _blobServiceClient .Received(1) @@ -163,8 +159,7 @@ public async Task return_unhealthy_when_checking_unhealthy_container() await _blobContainerClient .Received(1) - .GetPropertiesAsync(conditions: null, cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .GetPropertiesAsync(conditions: null, cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Unhealthy); actual @@ -192,7 +187,7 @@ public async Task return_unhealthy_when_invoked_from_healthcheckservice() .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Container not found")); var service = provider.GetRequiredService(); - var report = await service.CheckHealthAsync().ConfigureAwait(false); + var report = await service.CheckHealthAsync(); _blobServiceClient .Received(1) @@ -201,8 +196,7 @@ public async Task return_unhealthy_when_invoked_from_healthcheckservice() await _blobContainerClient .Received(1) - .GetPropertiesAsync(conditions: null, cancellationToken: Arg.Any()) - .ConfigureAwait(false); + .GetPropertiesAsync(conditions: null, cancellationToken: Arg.Any()); var actual = report.Entries[HealthCheckName]; actual.Status.ShouldBe(HealthStatus.Unhealthy); diff --git a/test/HealthChecks.Azure.Storage.Blobs.Tests/HealthChecks.Azure.Storage.Blobs.Tests.csproj b/test/HealthChecks.Azure.Storage.Blobs.Tests/HealthChecks.Azure.Storage.Blobs.Tests.csproj index 53dc133c88..272c3ce9c7 100644 --- a/test/HealthChecks.Azure.Storage.Blobs.Tests/HealthChecks.Azure.Storage.Blobs.Tests.csproj +++ b/test/HealthChecks.Azure.Storage.Blobs.Tests/HealthChecks.Azure.Storage.Blobs.Tests.csproj @@ -1,7 +1,7 @@ - + diff --git a/test/HealthChecks.Azure.Storage.Files.Shares.Tests/AzureFileShareHealthCheckTests.cs b/test/HealthChecks.Azure.Storage.Files.Shares.Tests/AzureFileShareHealthCheckTests.cs index 2adebe613c..273cef085f 100644 --- a/test/HealthChecks.Azure.Storage.Files.Shares.Tests/AzureFileShareHealthCheckTests.cs +++ b/test/HealthChecks.Azure.Storage.Files.Shares.Tests/AzureFileShareHealthCheckTests.cs @@ -41,7 +41,7 @@ public async Task return_healthy_when_only_checking_healthy_service() .GetSharesAsync(cancellationToken: tokenSource.Token) .Returns(AsyncPageable.FromPages(Array.Empty>())); - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _shareServiceClient .Received(1) @@ -49,8 +49,7 @@ public async Task return_healthy_when_only_checking_healthy_service() await _shareClient .DidNotReceiveWithAnyArgs() - .GetPropertiesAsync(default) - .ConfigureAwait(false); + .GetPropertiesAsync(default); actual.Status.ShouldBe(HealthStatus.Healthy); } @@ -69,7 +68,7 @@ public async Task return_healthy_when_checking_healthy_service_and_share() .Returns(Substitute.For>()); _options.ShareName = ShareName; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _shareServiceClient .Received(1) @@ -77,8 +76,7 @@ public async Task return_healthy_when_checking_healthy_service_and_share() await _shareClient .Received(1) - .GetPropertiesAsync(tokenSource.Token) - .ConfigureAwait(false); + .GetPropertiesAsync(tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Healthy); } @@ -111,7 +109,7 @@ public async Task return_unhealthy_when_checking_unhealthy_service(bool checkSha .Returns(pageable); _options.ShareName = checkShare ? ShareName : null; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _shareServiceClient .Received(1) @@ -127,13 +125,11 @@ public async Task return_unhealthy_when_checking_unhealthy_service(bool checkSha await enumerator .Received(1) - .MoveNextAsync() - .ConfigureAwait(false); + .MoveNextAsync(); await _shareClient .DidNotReceiveWithAnyArgs() - .GetPropertiesAsync(default) - .ConfigureAwait(false); + .GetPropertiesAsync(default); actual .Exception!.ShouldBeOfType() @@ -154,7 +150,7 @@ public async Task return_unhealthy_when_checking_unhealthy_share() .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "File share not found")); _options.ShareName = ShareName; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _shareServiceClient .Received(1) @@ -162,8 +158,7 @@ public async Task return_unhealthy_when_checking_unhealthy_share() await _shareClient .Received(1) - .GetPropertiesAsync(tokenSource.Token) - .ConfigureAwait(false); + .GetPropertiesAsync(tokenSource.Token); actual .Exception!.ShouldBeOfType() @@ -190,7 +185,7 @@ public async Task return_unhealthy_when_invoked_from_healthcheckservice() .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "File share not found")); var service = provider.GetRequiredService(); - var report = await service.CheckHealthAsync().ConfigureAwait(false); + var report = await service.CheckHealthAsync(); _shareServiceClient .Received(1) @@ -198,8 +193,7 @@ public async Task return_unhealthy_when_invoked_from_healthcheckservice() await _shareClient .Received(1) - .GetPropertiesAsync(Arg.Any()) - .ConfigureAwait(false); + .GetPropertiesAsync(Arg.Any()); var actual = report.Entries[HealthCheckName]; actual.Status.ShouldBe(HealthStatus.Unhealthy); diff --git a/test/HealthChecks.Azure.Storage.Files.Shares.Tests/HealthChecks.Azure.Storage.Files.Shares.Tests.csproj b/test/HealthChecks.Azure.Storage.Files.Shares.Tests/HealthChecks.Azure.Storage.Files.Shares.Tests.csproj index f876acef7b..13ee96ed3d 100644 --- a/test/HealthChecks.Azure.Storage.Files.Shares.Tests/HealthChecks.Azure.Storage.Files.Shares.Tests.csproj +++ b/test/HealthChecks.Azure.Storage.Files.Shares.Tests/HealthChecks.Azure.Storage.Files.Shares.Tests.csproj @@ -1,7 +1,7 @@ - + diff --git a/test/HealthChecks.Azure.Storage.Queues.Tests/AzureQueueStorageHealthCheckTests.cs b/test/HealthChecks.Azure.Storage.Queues.Tests/AzureQueueStorageHealthCheckTests.cs index 1da29cba37..f5583b8943 100644 --- a/test/HealthChecks.Azure.Storage.Queues.Tests/AzureQueueStorageHealthCheckTests.cs +++ b/test/HealthChecks.Azure.Storage.Queues.Tests/AzureQueueStorageHealthCheckTests.cs @@ -41,7 +41,7 @@ public async Task return_healthy_when_only_checking_healthy_service() .GetQueuesAsync(cancellationToken: tokenSource.Token) .Returns(AsyncPageable.FromPages(Array.Empty>())); - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _queueServiceClient .Received(1) @@ -49,8 +49,7 @@ public async Task return_healthy_when_only_checking_healthy_service() await _queueClient .DidNotReceiveWithAnyArgs() - .GetPropertiesAsync(default) - .ConfigureAwait(false); + .GetPropertiesAsync(default); actual.Status.ShouldBe(HealthStatus.Healthy); } @@ -69,7 +68,7 @@ public async Task return_healthy_when_checking_healthy_service_and_queue() .Returns(Substitute.For>()); _options.QueueName = QueueName; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _queueServiceClient .Received(1) @@ -77,8 +76,7 @@ public async Task return_healthy_when_checking_healthy_service_and_queue() await _queueClient .Received(1) - .GetPropertiesAsync(tokenSource.Token) - .ConfigureAwait(false); + .GetPropertiesAsync(tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Healthy); } @@ -111,7 +109,7 @@ public async Task return_unhealthy_when_checking_unhealthy_service(bool checkQue .Returns(pageable); _options.QueueName = checkQueue ? QueueName : null; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _queueServiceClient .Received(1) @@ -127,13 +125,11 @@ public async Task return_unhealthy_when_checking_unhealthy_service(bool checkQue await enumerator .Received(1) - .MoveNextAsync() - .ConfigureAwait(false); + .MoveNextAsync(); await _queueClient .DidNotReceiveWithAnyArgs() - .GetPropertiesAsync(default) - .ConfigureAwait(false); + .GetPropertiesAsync(default); actual .Exception!.ShouldBeOfType() @@ -154,7 +150,7 @@ public async Task return_unhealthy_when_checking_unhealthy_queue() .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Queue not found")); _options.QueueName = QueueName; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); _queueServiceClient .Received(1) @@ -162,8 +158,7 @@ public async Task return_unhealthy_when_checking_unhealthy_queue() await _queueClient .Received(1) - .GetPropertiesAsync(tokenSource.Token) - .ConfigureAwait(false); + .GetPropertiesAsync(tokenSource.Token); actual .Exception!.ShouldBeOfType() @@ -190,7 +185,7 @@ public async Task return_unhealthy_when_invoked_from_healthcheckservice() .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Queue not found")); var service = provider.GetRequiredService(); - var report = await service.CheckHealthAsync().ConfigureAwait(false); + var report = await service.CheckHealthAsync(); _queueServiceClient .Received(1) @@ -198,8 +193,7 @@ public async Task return_unhealthy_when_invoked_from_healthcheckservice() await _queueClient .Received(1) - .GetPropertiesAsync(Arg.Any()) - .ConfigureAwait(false); + .GetPropertiesAsync(Arg.Any()); var actual = report.Entries[HealthCheckName]; actual.Status.ShouldBe(HealthStatus.Unhealthy); diff --git a/test/HealthChecks.Azure.Storage.Queues.Tests/HealthChecks.Azure.Storage.Queues.Tests.csproj b/test/HealthChecks.Azure.Storage.Queues.Tests/HealthChecks.Azure.Storage.Queues.Tests.csproj index 158fd13339..5b7910591b 100644 --- a/test/HealthChecks.Azure.Storage.Queues.Tests/HealthChecks.Azure.Storage.Queues.Tests.csproj +++ b/test/HealthChecks.Azure.Storage.Queues.Tests/HealthChecks.Azure.Storage.Queues.Tests.csproj @@ -1,7 +1,7 @@ - + diff --git a/test/HealthChecks.AzureDigitalTwin.Tests/HealthChecks.AzureDigitalTwin.Tests.csproj b/test/HealthChecks.AzureDigitalTwin.Tests/HealthChecks.AzureDigitalTwin.Tests.csproj index e40b13be16..2793473a9d 100644 --- a/test/HealthChecks.AzureDigitalTwin.Tests/HealthChecks.AzureDigitalTwin.Tests.csproj +++ b/test/HealthChecks.AzureDigitalTwin.Tests/HealthChecks.AzureDigitalTwin.Tests.csproj @@ -1,7 +1,7 @@ - + diff --git a/test/HealthChecks.AzureKeyVault.Tests/Functional/AzureKeyVaultHealthCheckTests.cs b/test/HealthChecks.AzureKeyVault.Tests/Functional/AzureKeyVaultHealthCheckTests.cs index cf463896dc..42c4e0f556 100644 --- a/test/HealthChecks.AzureKeyVault.Tests/Functional/AzureKeyVaultHealthCheckTests.cs +++ b/test/HealthChecks.AzureKeyVault.Tests/Functional/AzureKeyVaultHealthCheckTests.cs @@ -33,7 +33,7 @@ public async Task be_unhealthy_if_keyvalue_is_not_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.AzureKeyVault.Tests/HealthChecks.AzureKeyVault.Tests.csproj b/test/HealthChecks.AzureKeyVault.Tests/HealthChecks.AzureKeyVault.Tests.csproj index 531e9c1650..7f873b9f87 100644 --- a/test/HealthChecks.AzureKeyVault.Tests/HealthChecks.AzureKeyVault.Tests.csproj +++ b/test/HealthChecks.AzureKeyVault.Tests/HealthChecks.AzureKeyVault.Tests.csproj @@ -1,7 +1,7 @@ - + diff --git a/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusQueueHealthCheckTests.cs b/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusQueueHealthCheckTests.cs index e6cb70bebf..e186d5ae37 100644 --- a/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusQueueHealthCheckTests.cs +++ b/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusQueueHealthCheckTests.cs @@ -50,8 +50,7 @@ await ExecuteHealthCheckAsync( QueueName, peakMode, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); if (peakMode) { @@ -79,14 +78,13 @@ await ExecuteHealthCheckAsync( QueueName, peakMode, connectionString: ConnectionString, - cancellationToken: tokenSource.Token).ConfigureAwait(false); + cancellationToken: tokenSource.Token); await ExecuteHealthCheckAsync( otherQueueName, peakMode, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); if (peakMode) { @@ -110,13 +108,11 @@ await ExecuteHealthCheckAsync( await _serviceBusAdministrationClient .Received(1) - .GetQueueRuntimePropertiesAsync(QueueName, tokenSource.Token) - .ConfigureAwait(false); + .GetQueueRuntimePropertiesAsync(QueueName, tokenSource.Token); await _serviceBusAdministrationClient .Received(1) - .GetQueueRuntimePropertiesAsync(otherQueueName, tokenSource.Token) - .ConfigureAwait(false); + .GetQueueRuntimePropertiesAsync(otherQueueName, tokenSource.Token); } } @@ -131,8 +127,7 @@ await ExecuteHealthCheckAsync( QueueName, peakMode, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); if (peakMode) { @@ -160,15 +155,13 @@ await ExecuteHealthCheckAsync( QueueName, peakMode, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); await ExecuteHealthCheckAsync( otherQueueName, peakMode, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); if (peakMode) { @@ -192,13 +185,11 @@ await ExecuteHealthCheckAsync( await _serviceBusAdministrationClient .Received(1) - .GetQueueRuntimePropertiesAsync(QueueName, tokenSource.Token) - .ConfigureAwait(false); + .GetQueueRuntimePropertiesAsync(QueueName, tokenSource.Token); await _serviceBusAdministrationClient .Received(1) - .GetQueueRuntimePropertiesAsync(otherQueueName, tokenSource.Token) - .ConfigureAwait(false); + .GetQueueRuntimePropertiesAsync(otherQueueName, tokenSource.Token); } } @@ -211,8 +202,7 @@ public async Task return_healthy_when_checking_healthy_service_through_peek_and_ QueueName, true, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Healthy); @@ -222,8 +212,7 @@ public async Task return_healthy_when_checking_healthy_service_through_peek_and_ await _serviceBusReceiver .Received(1) - .PeekMessageAsync(cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .PeekMessageAsync(cancellationToken: tokenSource.Token); } [Fact] @@ -235,8 +224,7 @@ public async Task return_healthy_when_checking_healthy_service_through_peek_and_ QueueName, true, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Healthy); @@ -246,8 +234,7 @@ public async Task return_healthy_when_checking_healthy_service_through_peek_and_ await _serviceBusReceiver .Received(1) - .PeekMessageAsync(cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .PeekMessageAsync(cancellationToken: tokenSource.Token); } [Fact] @@ -263,8 +250,7 @@ public async Task return_unhealthy_when_exception_is_thrown_by_client() QueueName, true, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Unhealthy); @@ -274,8 +260,7 @@ public async Task return_unhealthy_when_exception_is_thrown_by_client() await _serviceBusReceiver .Received(1) - .PeekMessageAsync(cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .PeekMessageAsync(cancellationToken: tokenSource.Token); } [Fact] @@ -287,15 +272,13 @@ public async Task return_healthy_when_checking_healthy_service_through_administr QueueName, false, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Healthy); await _serviceBusAdministrationClient .Received(1) - .GetQueueRuntimePropertiesAsync(QueueName, cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .GetQueueRuntimePropertiesAsync(QueueName, cancellationToken: tokenSource.Token); } [Fact] @@ -307,15 +290,13 @@ public async Task return_healthy_when_checking_healthy_service_through_administr QueueName, false, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Healthy); await _serviceBusAdministrationClient .Received(1) - .GetQueueRuntimePropertiesAsync(QueueName, cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .GetQueueRuntimePropertiesAsync(QueueName, cancellationToken: tokenSource.Token); } [Fact] @@ -331,15 +312,13 @@ public async Task return_unhealthy_when_exception_is_thrown_by_administration_cl QueueName, false, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Unhealthy); await _serviceBusAdministrationClient .Received(1) - .GetQueueRuntimePropertiesAsync(QueueName, cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .GetQueueRuntimePropertiesAsync(QueueName, cancellationToken: tokenSource.Token); } private Task ExecuteHealthCheckAsync( diff --git a/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusQueueMessageCountThresholdHealthCheckTests.cs b/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusQueueMessageCountThresholdHealthCheckTests.cs index 89619926da..93cc21623a 100644 --- a/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusQueueMessageCountThresholdHealthCheckTests.cs +++ b/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusQueueMessageCountThresholdHealthCheckTests.cs @@ -40,8 +40,7 @@ public async Task can_create_client_with_connection_string() await ExecuteHealthCheckAsync( QueueName, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); _clientProvider .Received(1) @@ -57,14 +56,12 @@ public async Task reuses_existing_client_when_using_same_connection_string_with_ await ExecuteHealthCheckAsync( QueueName, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); await ExecuteHealthCheckAsync( otherQueueName, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); _clientProvider .Received(1) @@ -72,13 +69,11 @@ await ExecuteHealthCheckAsync( await _serviceBusAdministrationClient .Received(1) - .GetQueueRuntimePropertiesAsync(QueueName, tokenSource.Token) - .ConfigureAwait(false); + .GetQueueRuntimePropertiesAsync(QueueName, tokenSource.Token); await _serviceBusAdministrationClient .Received(1) - .GetQueueRuntimePropertiesAsync(otherQueueName, tokenSource.Token) - .ConfigureAwait(false); + .GetQueueRuntimePropertiesAsync(otherQueueName, tokenSource.Token); } [Fact] @@ -89,8 +84,7 @@ public async Task can_create_client_with_fully_qualified_endpoint() await ExecuteHealthCheckAsync( QueueName, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); _clientProvider .Received(1) @@ -106,14 +100,12 @@ public async Task reuses_existing_client_when_using_same_fully_qualified_name_wi await ExecuteHealthCheckAsync( QueueName, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); await ExecuteHealthCheckAsync( otherQueueName, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); _clientProvider .Received(1) @@ -121,13 +113,11 @@ await ExecuteHealthCheckAsync( await _serviceBusAdministrationClient .Received(1) - .GetQueueRuntimePropertiesAsync(QueueName, tokenSource.Token) - .ConfigureAwait(false); + .GetQueueRuntimePropertiesAsync(QueueName, tokenSource.Token); await _serviceBusAdministrationClient .Received(1) - .GetQueueRuntimePropertiesAsync(otherQueueName, tokenSource.Token) - .ConfigureAwait(false); + .GetQueueRuntimePropertiesAsync(otherQueueName, tokenSource.Token); } [Fact] @@ -145,15 +135,13 @@ public async Task return_healthy_when_active_message_threshold_is_null() QueueName, activeMessagesCountThreshold: null, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Healthy); await _serviceBusAdministrationClient .Received(1) - .GetQueueRuntimePropertiesAsync(QueueName, cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .GetQueueRuntimePropertiesAsync(QueueName, cancellationToken: tokenSource.Token); } [Theory] @@ -186,15 +174,13 @@ public async Task return_expected_health_status_based_on_active_message_threshol QueueName, connectionString: ConnectionString, activeMessagesCountThreshold: messageCountThreshold, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(expectedHealthStatus); await _serviceBusAdministrationClient .Received(1) - .GetQueueRuntimePropertiesAsync(QueueName, cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .GetQueueRuntimePropertiesAsync(QueueName, cancellationToken: tokenSource.Token); } [Theory] @@ -227,15 +213,13 @@ public async Task return_expected_health_status_based_on_dead_letter_message_thr QueueName, connectionString: ConnectionString, deadLetterMessagesCountThreshold: messageCountThreshold, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(expectedHealthStatus); await _serviceBusAdministrationClient .Received(1) - .GetQueueRuntimePropertiesAsync(QueueName, cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .GetQueueRuntimePropertiesAsync(QueueName, cancellationToken: tokenSource.Token); } private Task ExecuteHealthCheckAsync( diff --git a/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusSubscriptionHealthCheckTests.cs b/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusSubscriptionHealthCheckTests.cs index 3de3c375c7..a3de7d96a6 100644 --- a/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusSubscriptionHealthCheckTests.cs +++ b/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusSubscriptionHealthCheckTests.cs @@ -52,8 +52,7 @@ await ExecuteHealthCheckAsync( TopicName, peakMode, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); if (peakMode) { @@ -81,15 +80,13 @@ await ExecuteHealthCheckAsync( TopicName, peakMode, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); await ExecuteHealthCheckAsync( otherTopicName, peakMode, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); if (peakMode) { @@ -113,13 +110,11 @@ await ExecuteHealthCheckAsync( await _serviceBusAdministrationClient .Received(1) - .GetSubscriptionRuntimePropertiesAsync(TopicName, SubscriptionName, tokenSource.Token) - .ConfigureAwait(false); + .GetSubscriptionRuntimePropertiesAsync(TopicName, SubscriptionName, tokenSource.Token); await _serviceBusAdministrationClient .Received(1) - .GetSubscriptionRuntimePropertiesAsync(otherTopicName, SubscriptionName, tokenSource.Token) - .ConfigureAwait(false); + .GetSubscriptionRuntimePropertiesAsync(otherTopicName, SubscriptionName, tokenSource.Token); } } @@ -134,7 +129,7 @@ await ExecuteHealthCheckAsync( TopicName, peakMode, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token).ConfigureAwait(false); + cancellationToken: tokenSource.Token); if (peakMode) { @@ -162,15 +157,13 @@ await ExecuteHealthCheckAsync( TopicName, peakMode, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); await ExecuteHealthCheckAsync( otherTopicName, peakMode, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); if (peakMode) { @@ -194,13 +187,11 @@ await ExecuteHealthCheckAsync( await _serviceBusAdministrationClient .Received(1) - .GetSubscriptionRuntimePropertiesAsync(TopicName, SubscriptionName, tokenSource.Token) - .ConfigureAwait(false); + .GetSubscriptionRuntimePropertiesAsync(TopicName, SubscriptionName, tokenSource.Token); await _serviceBusAdministrationClient .Received(1) - .GetSubscriptionRuntimePropertiesAsync(otherTopicName, SubscriptionName, tokenSource.Token) - .ConfigureAwait(false); + .GetSubscriptionRuntimePropertiesAsync(otherTopicName, SubscriptionName, tokenSource.Token); } } @@ -213,8 +204,7 @@ public async Task return_healthy_when_checking_healthy_service_through_peek_and_ TopicName, true, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); _serviceBusClient .Received(1) @@ -224,8 +214,7 @@ public async Task return_healthy_when_checking_healthy_service_through_peek_and_ await _serviceBusReceiver .Received(1) - .PeekMessageAsync(cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .PeekMessageAsync(cancellationToken: tokenSource.Token); } [Fact] @@ -237,8 +226,7 @@ public async Task return_healthy_when_checking_healthy_service_through_peek_and_ TopicName, true, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Healthy); @@ -248,8 +236,7 @@ public async Task return_healthy_when_checking_healthy_service_through_peek_and_ await _serviceBusReceiver .Received(1) - .PeekMessageAsync(cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .PeekMessageAsync(cancellationToken: tokenSource.Token); } [Fact] @@ -265,8 +252,7 @@ public async Task return_unhealthy_when_exception_is_thrown_by_client() TopicName, true, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Unhealthy); @@ -276,8 +262,7 @@ public async Task return_unhealthy_when_exception_is_thrown_by_client() await _serviceBusReceiver .Received(1) - .PeekMessageAsync(cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .PeekMessageAsync(cancellationToken: tokenSource.Token); } [Fact] @@ -289,15 +274,13 @@ public async Task return_healthy_when_checking_healthy_service_through_administr TopicName, false, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Healthy); await _serviceBusAdministrationClient .Received(1) - .GetSubscriptionRuntimePropertiesAsync(TopicName, SubscriptionName, cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .GetSubscriptionRuntimePropertiesAsync(TopicName, SubscriptionName, cancellationToken: tokenSource.Token); } [Fact] @@ -309,15 +292,13 @@ public async Task return_healthy_when_checking_healthy_service_through_administr TopicName, false, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Healthy); await _serviceBusAdministrationClient .Received(1) - .GetSubscriptionRuntimePropertiesAsync(TopicName, SubscriptionName, cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .GetSubscriptionRuntimePropertiesAsync(TopicName, SubscriptionName, cancellationToken: tokenSource.Token); } [Fact] @@ -332,15 +313,13 @@ public async Task return_unhealthy_when_exception_is_thrown_by_administration_cl var actual = await ExecuteHealthCheckAsync( TopicName, false, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Unhealthy); await _serviceBusAdministrationClient .Received(1) - .GetSubscriptionRuntimePropertiesAsync(TopicName, SubscriptionName, cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .GetSubscriptionRuntimePropertiesAsync(TopicName, SubscriptionName, cancellationToken: tokenSource.Token); } private Task ExecuteHealthCheckAsync( diff --git a/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusTopicHealthCheckTests.cs b/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusTopicHealthCheckTests.cs index 32075b05e3..a131d77788 100644 --- a/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusTopicHealthCheckTests.cs +++ b/test/HealthChecks.AzureServiceBus.Tests/AzureServiceBusTopicHealthCheckTests.cs @@ -39,8 +39,7 @@ public async Task can_create_client_with_connection_string() await ExecuteHealthCheckAsync( TopicName, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); _clientProvider .Received(1) @@ -56,14 +55,12 @@ public async Task reuses_existing_client_when_using_same_connection_string_with_ await ExecuteHealthCheckAsync( TopicName, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); await ExecuteHealthCheckAsync( otherTopicName, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); _clientProvider .Received(1) @@ -71,13 +68,11 @@ await ExecuteHealthCheckAsync( await _serviceBusAdministrationClient .Received(1) - .GetTopicRuntimePropertiesAsync(TopicName, tokenSource.Token) - .ConfigureAwait(false); + .GetTopicRuntimePropertiesAsync(TopicName, tokenSource.Token); await _serviceBusAdministrationClient .Received(1) - .GetTopicRuntimePropertiesAsync(otherTopicName, tokenSource.Token) - .ConfigureAwait(false); + .GetTopicRuntimePropertiesAsync(otherTopicName, tokenSource.Token); } [Fact] @@ -88,8 +83,7 @@ public async Task can_create_client_with_fully_qualified_name() await ExecuteHealthCheckAsync( TopicName, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); _clientProvider .Received(1) @@ -105,14 +99,12 @@ public async Task reuses_existing_client_when_using_same_fully_qualified_name_wi await ExecuteHealthCheckAsync( TopicName, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); await ExecuteHealthCheckAsync( otherTopicName, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); _clientProvider .Received(1) @@ -120,13 +112,11 @@ await ExecuteHealthCheckAsync( await _serviceBusAdministrationClient .Received(1) - .GetTopicRuntimePropertiesAsync(TopicName, tokenSource.Token) - .ConfigureAwait(false); + .GetTopicRuntimePropertiesAsync(TopicName, tokenSource.Token); await _serviceBusAdministrationClient .Received(1) - .GetTopicRuntimePropertiesAsync(otherTopicName, tokenSource.Token) - .ConfigureAwait(false); + .GetTopicRuntimePropertiesAsync(otherTopicName, tokenSource.Token); } [Fact] @@ -137,8 +127,7 @@ public async Task return_healthy_when_only_checking_healthy_service_through_admi var actual = await ExecuteHealthCheckAsync( TopicName, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Healthy); @@ -148,8 +137,7 @@ public async Task return_healthy_when_only_checking_healthy_service_through_admi await _serviceBusAdministrationClient .Received(1) - .GetTopicRuntimePropertiesAsync(TopicName, cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .GetTopicRuntimePropertiesAsync(TopicName, cancellationToken: tokenSource.Token); } [Fact] @@ -160,8 +148,7 @@ public async Task return_healthy_when_only_checking_healthy_service_through_admi var actual = await ExecuteHealthCheckAsync( TopicName, fullyQualifiedName: FullyQualifiedName, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Healthy); @@ -171,8 +158,7 @@ public async Task return_healthy_when_only_checking_healthy_service_through_admi await _serviceBusAdministrationClient .Received(1) - .GetTopicRuntimePropertiesAsync(TopicName, cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .GetTopicRuntimePropertiesAsync(TopicName, cancellationToken: tokenSource.Token); } [Fact] @@ -187,15 +173,13 @@ public async Task return_unhealthy_when_exception_is_thrown_by_administration_cl var actual = await ExecuteHealthCheckAsync( TopicName, connectionString: ConnectionString, - cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + cancellationToken: tokenSource.Token); actual.Status.ShouldBe(HealthStatus.Unhealthy); await _serviceBusAdministrationClient .Received(1) - .GetTopicRuntimePropertiesAsync(TopicName, cancellationToken: tokenSource.Token) - .ConfigureAwait(false); + .GetTopicRuntimePropertiesAsync(TopicName, cancellationToken: tokenSource.Token); } private Task ExecuteHealthCheckAsync( diff --git a/test/HealthChecks.AzureServiceBus.Tests/HealthChecks.AzureServiceBus.Tests.csproj b/test/HealthChecks.AzureServiceBus.Tests/HealthChecks.AzureServiceBus.Tests.csproj index 930dac84e4..a9389927fe 100644 --- a/test/HealthChecks.AzureServiceBus.Tests/HealthChecks.AzureServiceBus.Tests.csproj +++ b/test/HealthChecks.AzureServiceBus.Tests/HealthChecks.AzureServiceBus.Tests.csproj @@ -1,7 +1,7 @@ - + diff --git a/test/HealthChecks.Consul.Tests/Functional/ConsulHealthCheckTests.cs b/test/HealthChecks.Consul.Tests/Functional/ConsulHealthCheckTests.cs index 890d55d0f5..7aa2e8550a 100644 --- a/test/HealthChecks.Consul.Tests/Functional/ConsulHealthCheckTests.cs +++ b/test/HealthChecks.Consul.Tests/Functional/ConsulHealthCheckTests.cs @@ -28,7 +28,7 @@ public async Task be_healthy_if_consul_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -57,7 +57,7 @@ public async Task be_unhealthy_if_consul_is_not_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.CosmosDb.Tests/CosmosDbHealthCheckTests.cs b/test/HealthChecks.CosmosDb.Tests/CosmosDbHealthCheckTests.cs index b8e3cf9529..7ce7f00ec1 100644 --- a/test/HealthChecks.CosmosDb.Tests/CosmosDbHealthCheckTests.cs +++ b/test/HealthChecks.CosmosDb.Tests/CosmosDbHealthCheckTests.cs @@ -50,24 +50,21 @@ public async Task return_healthy_when_only_checking_healthy_service() .ReadAccountAsync() .Returns(Substitute.For()); - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); await _cosmosClient .Received(1) - .ReadAccountAsync() - .ConfigureAwait(false); + .ReadAccountAsync(); await _database .DidNotReceiveWithAnyArgs() - .ReadAsync(default) - .ConfigureAwait(false); + .ReadAsync(default); await Task.WhenAll(_containers .Values .Select(x => x .DidNotReceiveWithAnyArgs() - .ReadContainerAsync(default, default))) - .ConfigureAwait(false); + .ReadContainerAsync(default, default))); actual.Status.ShouldBe(HealthStatus.Healthy); } @@ -86,24 +83,21 @@ public async Task return_healthy_when_checking_healthy_service_and_database() .Returns(Substitute.For()); _options.DatabaseId = DatabaseId; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); await _cosmosClient .Received(1) - .ReadAccountAsync() - .ConfigureAwait(false); + .ReadAccountAsync(); await _database .Received(1) - .ReadAsync(null, tokenSource.Token) - .ConfigureAwait(false); + .ReadAsync(null, tokenSource.Token); await Task.WhenAll(_containers .Values .Select(x => x .DidNotReceiveWithAnyArgs() - .ReadContainerAsync(default, default))) - .ConfigureAwait(false); + .ReadContainerAsync(default, default))); actual.Status.ShouldBe(HealthStatus.Healthy); } @@ -130,24 +124,21 @@ public async Task return_healthy_when_checking_healthy_service_database_and_cont _options.ContainerIds = ContainerIds; _options.DatabaseId = DatabaseId; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); await _cosmosClient .Received(1) - .ReadAccountAsync() - .ConfigureAwait(false); + .ReadAccountAsync(); await _database .Received(1) - .ReadAsync(null, tokenSource.Token) - .ConfigureAwait(false); + .ReadAsync(null, tokenSource.Token); await Task.WhenAll(_containers .Values .Select(x => x .Received(1) - .ReadContainerAsync(null, tokenSource.Token))) - .ConfigureAwait(false); + .ReadContainerAsync(null, tokenSource.Token))); actual.Status.ShouldBe(HealthStatus.Healthy); } @@ -166,24 +157,21 @@ public async Task return_unhealthy_when_checking_unhealthy_service(bool checkDat _options.ContainerIds = checkContainers ? ContainerIds : null; _options.DatabaseId = checkDatabase ? DatabaseId : null; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); await _cosmosClient .Received(1) - .ReadAccountAsync() - .ConfigureAwait(false); + .ReadAccountAsync(); await _database .DidNotReceiveWithAnyArgs() - .ReadAsync(default) - .ConfigureAwait(false); + .ReadAsync(default); await Task.WhenAll(_containers .Values .Select(x => x .DidNotReceiveWithAnyArgs() - .ReadContainerAsync(default, default))) - .ConfigureAwait(false); + .ReadContainerAsync(default, default))); actual.Status.ShouldBe(HealthStatus.Unhealthy); actual @@ -208,24 +196,21 @@ public async Task return_unhealthy_when_checking_unhealthy_database(bool checkCo _options.ContainerIds = checkContainers ? ContainerIds : null; _options.DatabaseId = DatabaseId; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); await _cosmosClient .Received(1) - .ReadAccountAsync() - .ConfigureAwait(false); + .ReadAccountAsync(); await _database .Received(1) - .ReadAsync(null, tokenSource.Token) - .ConfigureAwait(false); + .ReadAsync(null, tokenSource.Token); await Task.WhenAll(_containers .Values .Select(x => x .DidNotReceiveWithAnyArgs() - .ReadContainerAsync(default, default))) - .ConfigureAwait(false); + .ReadContainerAsync(default, default))); actual.Status.ShouldBe(HealthStatus.Unhealthy); actual @@ -256,32 +241,27 @@ public async Task return_unhealthy_when_checking_unhealthy_container() _options.ContainerIds = ContainerIds; _options.DatabaseId = DatabaseId; - var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token).ConfigureAwait(false); + var actual = await _healthCheck.CheckHealthAsync(_context, tokenSource.Token); await _cosmosClient .Received(1) - .ReadAccountAsync() - .ConfigureAwait(false); + .ReadAccountAsync(); await _database .Received(1) - .ReadAsync(null, tokenSource.Token) - .ConfigureAwait(false); + .ReadAsync(null, tokenSource.Token); await _containers["one"] .Received(1) - .ReadContainerAsync(null, tokenSource.Token) - .ConfigureAwait(false); + .ReadContainerAsync(null, tokenSource.Token); await _containers["two"] .Received(1) - .ReadContainerAsync(null, tokenSource.Token) - .ConfigureAwait(false); + .ReadContainerAsync(null, tokenSource.Token); await _containers["three"] .DidNotReceiveWithAnyArgs() - .ReadContainerAsync(default, default) - .ConfigureAwait(false); + .ReadContainerAsync(default, default); actual.Status.ShouldBe(HealthStatus.Unhealthy); actual @@ -309,24 +289,21 @@ public async Task return_unhealthy_when_invoked_from_healthcheckservice() .ThrowsAsync(new RequestFailedException((int)HttpStatusCode.NotFound, "Database not found")); var service = provider.GetRequiredService(); - var report = await service.CheckHealthAsync().ConfigureAwait(false); + var report = await service.CheckHealthAsync(); await _cosmosClient .Received(1) - .ReadAccountAsync() - .ConfigureAwait(false); + .ReadAccountAsync(); await _database .Received(1) - .ReadAsync(null, Arg.Any()) - .ConfigureAwait(false); + .ReadAsync(null, Arg.Any()); await Task.WhenAll(_containers .Values .Select(x => x .DidNotReceiveWithAnyArgs() - .ReadContainerAsync(default, default))) - .ConfigureAwait(false); + .ReadContainerAsync(default, default))); var actual = report.Entries[HealthCheckName]; actual.Status.ShouldBe(HealthStatus.Unhealthy); diff --git a/test/HealthChecks.Elasticsearch.Tests/Functional/ElasticsearchAuthenticationTests.cs b/test/HealthChecks.Elasticsearch.Tests/Functional/ElasticsearchAuthenticationTests.cs index f5210f5fe6..2bcf44def3 100644 --- a/test/HealthChecks.Elasticsearch.Tests/Functional/ElasticsearchAuthenticationTests.cs +++ b/test/HealthChecks.Elasticsearch.Tests/Functional/ElasticsearchAuthenticationTests.cs @@ -42,8 +42,7 @@ public async Task be_healthy_if_elasticsearch_is_using_valid_api_key() using var server = new TestServer(webHostBuilder); var response = await server.CreateRequest("/health") - .GetAsync() - .ConfigureAwait(false); + .GetAsync(); response.StatusCode .ShouldBe(HttpStatusCode.OK); @@ -78,8 +77,7 @@ public async Task be_healthy_if_elasticsearch_is_using_valid_user_and_password() using var server = new TestServer(webHostBuilder); var response = await server.CreateRequest("/health") - .GetAsync() - .ConfigureAwait(false); + .GetAsync(); response.StatusCode .ShouldBe(HttpStatusCode.OK); diff --git a/test/HealthChecks.Elasticsearch.Tests/Functional/ElasticsearchHealthCheckTests.cs b/test/HealthChecks.Elasticsearch.Tests/Functional/ElasticsearchHealthCheckTests.cs index 737dba62d3..d477d3acd4 100644 --- a/test/HealthChecks.Elasticsearch.Tests/Functional/ElasticsearchHealthCheckTests.cs +++ b/test/HealthChecks.Elasticsearch.Tests/Functional/ElasticsearchHealthCheckTests.cs @@ -25,7 +25,7 @@ public async Task be_healthy_if_elasticsearch_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -49,7 +49,7 @@ public async Task be_unhealthy_if_elasticsearch_is_not_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.EventStore.Tests/Functional/EventStoreHealthCheckTests.cs b/test/HealthChecks.EventStore.Tests/Functional/EventStoreHealthCheckTests.cs index 6d4455a484..1c679f1782 100644 --- a/test/HealthChecks.EventStore.Tests/Functional/EventStoreHealthCheckTests.cs +++ b/test/HealthChecks.EventStore.Tests/Functional/EventStoreHealthCheckTests.cs @@ -25,9 +25,9 @@ public async Task be_healthy_if_eventstore_is_available_with_uri_format() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); - response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync()); } [Fact] @@ -50,9 +50,9 @@ public async Task be_healthy_if_eventstore_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); - response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync()); } [Fact] @@ -76,8 +76,8 @@ public async Task be_unhealthy_if_eventstore_is_not_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); - response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable, await response.Content.ReadAsStringAsync()); } } diff --git a/test/HealthChecks.EventStore.gRPC.Tests/Functional/EventStoreHealthCheckTests.cs b/test/HealthChecks.EventStore.gRPC.Tests/Functional/EventStoreHealthCheckTests.cs index 89d49e7413..c4a740051e 100644 --- a/test/HealthChecks.EventStore.gRPC.Tests/Functional/EventStoreHealthCheckTests.cs +++ b/test/HealthChecks.EventStore.gRPC.Tests/Functional/EventStoreHealthCheckTests.cs @@ -23,7 +23,7 @@ public async Task be_healthy_if_eventstore_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -47,7 +47,7 @@ public async Task be_unhealthy_if_eventstore_tls_settings_do_not_match() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -71,7 +71,7 @@ public async Task be_unhealthy_if_eventstore_is_not_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.Gremlin.Tests/Functional/GremlinHealthCheckTests.cs b/test/HealthChecks.Gremlin.Tests/Functional/GremlinHealthCheckTests.cs index 213758bc0a..22a2340e36 100644 --- a/test/HealthChecks.Gremlin.Tests/Functional/GremlinHealthCheckTests.cs +++ b/test/HealthChecks.Gremlin.Tests/Functional/GremlinHealthCheckTests.cs @@ -28,7 +28,7 @@ public async Task be_healthy_if_gremlin_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -63,7 +63,7 @@ public async Task be_healthy_if_multiple_gremlin_are_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -92,7 +92,7 @@ public async Task be_unhealthy_if_gremlin_is_not_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.IbmMQ.Tests/Functional/IbmMQHealthCheckTests.cs b/test/HealthChecks.IbmMQ.Tests/Functional/IbmMQHealthCheckTests.cs index 7cca4bf279..9043a12956 100644 --- a/test/HealthChecks.IbmMQ.Tests/Functional/IbmMQHealthCheckTests.cs +++ b/test/HealthChecks.IbmMQ.Tests/Functional/IbmMQHealthCheckTests.cs @@ -52,7 +52,7 @@ public async Task be_healthy_if_ibmmq_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -86,7 +86,7 @@ public async Task be_unhealthy_if_ibmmq_is_unavailable() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -111,7 +111,7 @@ public async Task be_unhealthy_if_ibmmq_managed_is_unavailable() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -136,7 +136,7 @@ public async Task be_healthy_if_ibmmq_managed_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } diff --git a/test/HealthChecks.InfluxDB.Tests/Functional/InfluxDBHealthCheckTests.cs b/test/HealthChecks.InfluxDB.Tests/Functional/InfluxDBHealthCheckTests.cs index 7684d60fc9..05b55ad5fc 100644 --- a/test/HealthChecks.InfluxDB.Tests/Functional/InfluxDBHealthCheckTests.cs +++ b/test/HealthChecks.InfluxDB.Tests/Functional/InfluxDBHealthCheckTests.cs @@ -24,7 +24,7 @@ public async Task be_healthy_if_influxdb_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -49,7 +49,7 @@ public async Task be_unhealthy_if_influxdb_is_unavailable() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.Kafka.Tests/Functional/KafkaHealthCheckTests.cs b/test/HealthChecks.Kafka.Tests/Functional/KafkaHealthCheckTests.cs index 23506e7400..606b5f0ed2 100644 --- a/test/HealthChecks.Kafka.Tests/Functional/KafkaHealthCheckTests.cs +++ b/test/HealthChecks.Kafka.Tests/Functional/KafkaHealthCheckTests.cs @@ -33,7 +33,7 @@ public async Task be_unhealthy_if_kafka_is_unavailable() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -63,7 +63,7 @@ public async Task be_healthy_if_kafka_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } diff --git a/test/HealthChecks.Kubernetes.Tests/Functional/KubernetesHealthCheckTests.cs b/test/HealthChecks.Kubernetes.Tests/Functional/KubernetesHealthCheckTests.cs index c96267741c..f636705494 100644 --- a/test/HealthChecks.Kubernetes.Tests/Functional/KubernetesHealthCheckTests.cs +++ b/test/HealthChecks.Kubernetes.Tests/Functional/KubernetesHealthCheckTests.cs @@ -29,7 +29,7 @@ public async Task be_unhealthy_if_kubernetes_is_unavailable() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -58,7 +58,7 @@ public async Task be_healthy_if_empty_registrations() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -87,7 +87,7 @@ public async Task be_healthy_if_kubernetes_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } diff --git a/test/HealthChecks.MongoDb.Tests/Functional/MongoDbHealthCheckTests.cs b/test/HealthChecks.MongoDb.Tests/Functional/MongoDbHealthCheckTests.cs index 7107ee5d6c..55482b6161 100644 --- a/test/HealthChecks.MongoDb.Tests/Functional/MongoDbHealthCheckTests.cs +++ b/test/HealthChecks.MongoDb.Tests/Functional/MongoDbHealthCheckTests.cs @@ -25,7 +25,7 @@ public async Task be_healthy_listing_all_databases_if_mongodb_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -51,7 +51,7 @@ public async Task be_healthy_on_specified_database_if_mongodb_is_available_and_d using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -76,7 +76,7 @@ public async Task be_healthy_on_connectionstring_specified_database_if_mongodb_i using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -102,7 +102,7 @@ public async Task be_healthy_on_connectionstring_specified_database_if_mongodb_i using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -126,7 +126,7 @@ public async Task be_unhealthy_listing_all_databases_if_mongodb_is_not_available using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -150,7 +150,7 @@ public async Task be_unhealthy_on_specified_database_if_mongodb_is_not_available using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.MySql.Tests/Functional/MySqlHealthCheckTests.cs b/test/HealthChecks.MySql.Tests/Functional/MySqlHealthCheckTests.cs index 521a396745..802b54f85c 100644 --- a/test/HealthChecks.MySql.Tests/Functional/MySqlHealthCheckTests.cs +++ b/test/HealthChecks.MySql.Tests/Functional/MySqlHealthCheckTests.cs @@ -25,7 +25,7 @@ public async Task be_healthy_when_mysql_server_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -51,7 +51,7 @@ public async Task be_unhealthy_when_mysql_server_is_unavailable() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -81,7 +81,7 @@ public async Task be_unhealthy_when_mysql_server_is_unavailable_using_options() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.Nats.Tests/Functional/NatsHealthCheckTests.cs b/test/HealthChecks.Nats.Tests/Functional/NatsHealthCheckTests.cs index 0285127f70..d8b4da6570 100644 --- a/test/HealthChecks.Nats.Tests/Functional/NatsHealthCheckTests.cs +++ b/test/HealthChecks.Nats.Tests/Functional/NatsHealthCheckTests.cs @@ -13,19 +13,19 @@ public class nats_healthcheck_should public Task be_healthy_if_nats_is_available_locally() => FactAsync( setup => setup.Url = DefaultLocalConnectionString, - async response => response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false))); + async response => response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync())); [Fact] public Task be_healthy_for_official_demo_instance() => FactAsync( setup => setup.Url = DemoConnectionString, - async response => response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false))); + async response => response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync())); [Fact] public Task be_healthy_if_nats_is_available_and_has_custom_name() => FactAsync( setup => setup.Url = DefaultLocalConnectionString, - async response => response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false)), + async response => response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync()), name: "Demo"); [Fact] @@ -35,7 +35,7 @@ public Task be_unhealthy_if_nats_endpoint_does_not_exist_or_is_offline() => async response => { response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); - var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var content = await response.Content.ReadAsStringAsync(); var report = JsonSerializer.Deserialize(content, new JsonSerializerOptions { PropertyNameCaseInsensitive = true, Converters = { new JsonStringEnumConverter() } })!; report.Status.ShouldBe(UIHealthStatus.Unhealthy); report.Entries["nats"].Exception.ShouldBe("Failed to connect"); @@ -49,7 +49,7 @@ public Task be_unhealthy_if_nats_endpoint_is_bogus() => async response => { response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); - var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var content = await response.Content.ReadAsStringAsync(); var report = JsonSerializer.Deserialize(content, new JsonSerializerOptions { PropertyNameCaseInsensitive = true, Converters = { new JsonStringEnumConverter() } })!; report.Status.ShouldBe(UIHealthStatus.Unhealthy); report.Entries["nats"].Exception.ShouldBe("Failed to connect"); diff --git a/test/HealthChecks.Network.Tests/Functional/DnsHealthCheckTests.cs b/test/HealthChecks.Network.Tests/Functional/DnsHealthCheckTests.cs index e431985dfb..e91210d57b 100644 --- a/test/HealthChecks.Network.Tests/Functional/DnsHealthCheckTests.cs +++ b/test/HealthChecks.Network.Tests/Functional/DnsHealthCheckTests.cs @@ -32,7 +32,7 @@ public async Task be_healthy_when_configured_hosts_dns_resolution_matches() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -55,7 +55,7 @@ public async Task be_unhealthy_when_dns_resolution_does_not_match_configured_hos }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.Network.Tests/Functional/DnsResolveCountHealthCheckTests.cs b/test/HealthChecks.Network.Tests/Functional/DnsResolveCountHealthCheckTests.cs index d13f4aa22b..230272527b 100644 --- a/test/HealthChecks.Network.Tests/Functional/DnsResolveCountHealthCheckTests.cs +++ b/test/HealthChecks.Network.Tests/Functional/DnsResolveCountHealthCheckTests.cs @@ -12,8 +12,8 @@ public class dns_resolve_host_count_should [Fact] public async Task be_healthy_when_the_configured_number_of_resolved_addresses_is_within_the_threshold() { - int addresses = (await Dns.GetHostAddressesAsync(hostName).ConfigureAwait(false)).Length; - int addresses2 = (await Dns.GetHostAddressesAsync(hostName2).ConfigureAwait(false)).Length; + int addresses = (await Dns.GetHostAddressesAsync(hostName)).Length; + int addresses2 = (await Dns.GetHostAddressesAsync(hostName2)).Length; var webHostBuilder = new WebHostBuilder() .ConfigureServices(services => @@ -41,7 +41,7 @@ public async Task be_healthy_when_the_configured_number_of_resolved_addresses_is }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -49,8 +49,8 @@ public async Task be_healthy_when_the_configured_number_of_resolved_addresses_is [Fact] public async Task be_unhealthy_when_the_configured_number_of_resolved_is_out_of_range() { - int addresses = (await Dns.GetHostAddressesAsync(hostName).ConfigureAwait(false)).Length; - int addresses2 = (await Dns.GetHostAddressesAsync(hostName2).ConfigureAwait(false)).Length; + int addresses = (await Dns.GetHostAddressesAsync(hostName)).Length; + int addresses2 = (await Dns.GetHostAddressesAsync(hostName2)).Length; var webHostBuilder = new WebHostBuilder() .ConfigureServices(services => @@ -79,7 +79,7 @@ public async Task be_unhealthy_when_the_configured_number_of_resolved_is_out_of_ }); using var server = new TestServer(webHostBuilder); - var response = await server.CreateClient().GetAsJson("/health").ConfigureAwait(false); + var response = await server.CreateClient().GetAsJson("/health"); response.ShouldNotBeNull(); } } diff --git a/test/HealthChecks.Network.Tests/Functional/FtpHealthCheckTests.cs b/test/HealthChecks.Network.Tests/Functional/FtpHealthCheckTests.cs index f3108da120..777cc93cd0 100644 --- a/test/HealthChecks.Network.Tests/Functional/FtpHealthCheckTests.cs +++ b/test/HealthChecks.Network.Tests/Functional/FtpHealthCheckTests.cs @@ -29,7 +29,7 @@ public async Task be_healthy_when_connection_is_successful() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe((HttpStatusCode)StatusCodes.Status200OK); } @@ -57,7 +57,7 @@ public async Task be_healthy_when_connection_is_successful_and_file_is_created() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -77,7 +77,7 @@ public async Task respect_configured_timeout_and_throw_operation_cancelled_excep failureStatus: HealthStatus.Degraded, null, timeout: null) - }, new CancellationTokenSource(TimeSpan.FromSeconds(2)).Token).ConfigureAwait(false); + }, new CancellationTokenSource(TimeSpan.FromSeconds(2)).Token); result.Exception.ShouldBeOfType(); } diff --git a/test/HealthChecks.Network.Tests/Functional/ImapHealthCheckTests.cs b/test/HealthChecks.Network.Tests/Functional/ImapHealthCheckTests.cs index 095645366a..9a58640a26 100644 --- a/test/HealthChecks.Network.Tests/Functional/ImapHealthCheckTests.cs +++ b/test/HealthChecks.Network.Tests/Functional/ImapHealthCheckTests.cs @@ -34,7 +34,7 @@ public async Task be_healthy_when_connecting_to_imap_ssl_port_without_login() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -63,7 +63,7 @@ public async Task be_healthy_when_connecting_to_imap_ssl_and_login_with_correct_ }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -93,7 +93,7 @@ public async Task be_unhealthy_when_connecting_to_imap_ssl_and_login_with_an_inc }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -123,7 +123,7 @@ public async Task be_healthy_when_connecting_to_imap_ssl_with_a_correct_account_ }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -153,7 +153,7 @@ public async Task be_unhealthy_when_connecting_to_imap_ssl_with_a_correct_accoun }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -181,7 +181,7 @@ public async Task be_healthy_when_imap_connects_to_starttls_port() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -210,7 +210,7 @@ public async Task be_healthy_when_imap_performs_login_using_starttls_handshake() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -241,7 +241,7 @@ public async Task be_healthy_when_imap_performs_login_and_folder_check_using_sta }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -271,7 +271,7 @@ public async Task be_unhealthy_when_using_configuration_auto_with_an_invalid_ima }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -292,7 +292,7 @@ public async Task respect_configured_timeout_and_throw_operation_cancelled_excep failureStatus: HealthStatus.Degraded, null, timeout: null) - }, new CancellationTokenSource(TimeSpan.FromSeconds(2)).Token).ConfigureAwait(false); + }, new CancellationTokenSource(TimeSpan.FromSeconds(2)).Token); result.Exception.ShouldBeOfType(); } diff --git a/test/HealthChecks.Network.Tests/Functional/PingHealthCheckTests.cs b/test/HealthChecks.Network.Tests/Functional/PingHealthCheckTests.cs index 5604c9c54d..dca913afb6 100644 --- a/test/HealthChecks.Network.Tests/Functional/PingHealthCheckTests.cs +++ b/test/HealthChecks.Network.Tests/Functional/PingHealthCheckTests.cs @@ -22,7 +22,7 @@ public async Task be_healthy_when_all_hosts_reply_to_ping() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -49,7 +49,7 @@ public async Task be_unhealthy_when_a_host_ping_is_not_successful() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.Network.Tests/Functional/SftpHealthCheckTests.cs b/test/HealthChecks.Network.Tests/Functional/SftpHealthCheckTests.cs index befb919f50..a869605943 100644 --- a/test/HealthChecks.Network.Tests/Functional/SftpHealthCheckTests.cs +++ b/test/HealthChecks.Network.Tests/Functional/SftpHealthCheckTests.cs @@ -31,7 +31,7 @@ public async Task be_healthy_when_connection_to_sftp_is_successful_using_passwor using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -62,7 +62,7 @@ public async Task be_unhealthy_when_connection_to_sftp_is_using_wrong_password() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -95,7 +95,7 @@ public async Task be_healthy_when_connection_to_sftp_is_successful_using_private using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -129,7 +129,7 @@ public async Task be_healthy_with_valid_authorization_and_file_creation_enabled( using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -163,7 +163,7 @@ public async Task be_healthy_with_one_valid_authorization() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -194,7 +194,7 @@ public async Task be_unhealthy_when_using_wrong_port() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.Network.Tests/Functional/SmtpHealthCheckTests.cs b/test/HealthChecks.Network.Tests/Functional/SmtpHealthCheckTests.cs index 6b8ecb0cb7..a53127b10c 100644 --- a/test/HealthChecks.Network.Tests/Functional/SmtpHealthCheckTests.cs +++ b/test/HealthChecks.Network.Tests/Functional/SmtpHealthCheckTests.cs @@ -37,7 +37,7 @@ public async Task be_healthy_when_connecting_using_ssl() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -67,7 +67,7 @@ public async Task be_healthy_when_connecting_using_tls() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -95,7 +95,7 @@ public async Task be_healthy_when_connecting_using_connection_type_auto() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -123,7 +123,7 @@ public async Task be_unhealthy_when_connecting_to_an_invalid_smtp_port_with_mode }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -152,7 +152,7 @@ public async Task be_healthy_when_connection_and_login_with_valid_account_using_ }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -181,7 +181,7 @@ public async Task be_healthy_when_connection_and_login_with_valid_account_using_ }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); @@ -211,7 +211,7 @@ public async Task be_unhealthy_when_connection_and_login_with_an_invalid_account }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); @@ -245,7 +245,7 @@ This test is skipped as this service might not be working in the future */ }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -266,7 +266,7 @@ public async Task respect_configured_timeout_and_throw_operation_cancelled_excep failureStatus: HealthStatus.Degraded, null, timeout: null) - }, new CancellationTokenSource(TimeSpan.FromMilliseconds(100)).Token).ConfigureAwait(false); + }, new CancellationTokenSource(TimeSpan.FromMilliseconds(100)).Token); result.Exception.ShouldBeOfType(); } diff --git a/test/HealthChecks.Network.Tests/Functional/SslHealthCheckTests.cs b/test/HealthChecks.Network.Tests/Functional/SslHealthCheckTests.cs index a19a37e0b7..3c55bab0f6 100644 --- a/test/HealthChecks.Network.Tests/Functional/SslHealthCheckTests.cs +++ b/test/HealthChecks.Network.Tests/Functional/SslHealthCheckTests.cs @@ -36,7 +36,7 @@ public async Task be_healthy_if_ssl_is_valid() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -60,7 +60,7 @@ public async Task be_unhealthy_if_ssl_is_not_present() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -84,7 +84,7 @@ public async Task be_unhealthy_if_ssl_is_not_valid() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -108,7 +108,7 @@ public async Task be_unhealthy_if_ssl_is_expired() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -132,10 +132,10 @@ public async Task be_degraded_if_ssl_daysbefore() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); - var resultAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var resultAsString = await response.Content.ReadAsStringAsync(); resultAsString.ShouldContain(HealthStatus.Unhealthy.ToString()); } @@ -155,7 +155,7 @@ public async Task respect_configured_timeout_and_throw_operation_cancelled_excep failureStatus: HealthStatus.Degraded, null, timeout: null) - }, new CancellationTokenSource(TimeSpan.FromSeconds(2)).Token).ConfigureAwait(false); + }, new CancellationTokenSource(TimeSpan.FromSeconds(2)).Token); result.Exception.ShouldBeOfType(); } diff --git a/test/HealthChecks.Network.Tests/Functional/TcpHealthCheckTests.cs b/test/HealthChecks.Network.Tests/Functional/TcpHealthCheckTests.cs index ba5ccb43a0..77f88e4288 100644 --- a/test/HealthChecks.Network.Tests/Functional/TcpHealthCheckTests.cs +++ b/test/HealthChecks.Network.Tests/Functional/TcpHealthCheckTests.cs @@ -22,7 +22,7 @@ public async Task respect_configured_timeout_and_throw_operation_cancelled_excep failureStatus: HealthStatus.Degraded, null, timeout: null) - }, new CancellationTokenSource(TimeSpan.FromSeconds(2)).Token).ConfigureAwait(false); + }, new CancellationTokenSource(TimeSpan.FromSeconds(2)).Token); result.Exception.ShouldBeOfType(); } diff --git a/test/HealthChecks.Network.Tests/HealthChecks.Network.Tests.csproj b/test/HealthChecks.Network.Tests/HealthChecks.Network.Tests.csproj index f4c63a342a..948765027f 100644 --- a/test/HealthChecks.Network.Tests/HealthChecks.Network.Tests.csproj +++ b/test/HealthChecks.Network.Tests/HealthChecks.Network.Tests.csproj @@ -2,7 +2,6 @@ - diff --git a/test/HealthChecks.Npgsql.Tests/Functional/NpgsqlHealthCheckTests.cs b/test/HealthChecks.Npgsql.Tests/Functional/NpgsqlHealthCheckTests.cs index bb227648ed..d76f01f5c2 100644 --- a/test/HealthChecks.Npgsql.Tests/Functional/NpgsqlHealthCheckTests.cs +++ b/test/HealthChecks.Npgsql.Tests/Functional/NpgsqlHealthCheckTests.cs @@ -32,7 +32,7 @@ public async Task be_healthy_if_npgsql_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -58,7 +58,7 @@ public async Task be_unhealthy_if_sql_query_is_not_valid() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -82,7 +82,7 @@ public async Task be_unhealthy_if_npgsql_is_not_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -111,7 +111,7 @@ public async Task be_healthy_if_npgsql_is_available_by_iServiceProvider_register using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -140,7 +140,7 @@ public async Task be_unhealthy_if_npgsql_is_not_available_registered() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -171,7 +171,7 @@ public async Task unhealthy_check_log_detailed_messages() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); var testLoggerProvider = (TestLoggerProvider)server.Services.GetRequiredService(); diff --git a/test/HealthChecks.OpenIdConnectServer.Tests/Functional/IdSvrHealthCheckTests.cs b/test/HealthChecks.OpenIdConnectServer.Tests/Functional/IdSvrHealthCheckTests.cs index eb3ac1ccdb..d4b8b6e478 100644 --- a/test/HealthChecks.OpenIdConnectServer.Tests/Functional/IdSvrHealthCheckTests.cs +++ b/test/HealthChecks.OpenIdConnectServer.Tests/Functional/IdSvrHealthCheckTests.cs @@ -23,7 +23,7 @@ public async Task be_unhealthy_if_idsvr_is_unavailable() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -47,7 +47,7 @@ public async Task be_healthy_if_idsvr_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } diff --git a/test/HealthChecks.Oracle.Tests/Functional/OracleHealthCheckTests.cs b/test/HealthChecks.Oracle.Tests/Functional/OracleHealthCheckTests.cs index c485951e56..8b6631f1b2 100644 --- a/test/HealthChecks.Oracle.Tests/Functional/OracleHealthCheckTests.cs +++ b/test/HealthChecks.Oracle.Tests/Functional/OracleHealthCheckTests.cs @@ -27,8 +27,8 @@ public async Task be_healthy_when_oracle_is_available() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); - response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + using var response = await server.CreateRequest("/health").GetAsync(); + response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync()); } [Fact] @@ -51,7 +51,7 @@ public async Task be_unhealthy_when_oracle_is_not_available() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -74,7 +74,7 @@ public async Task be_unhealthy_when_sql_query_is_not_valid() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -105,8 +105,8 @@ public async Task be_healthy_with_connection_string_factory_when_oracle_is_avail }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); - response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + using var response = await server.CreateRequest("/health").GetAsync(); + response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync()); factoryCalled.ShouldBeTrue(); } @@ -141,8 +141,8 @@ public async Task be_healthy_with_connection_string_and_credential_when_oracle_i }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); - response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + using var response = await server.CreateRequest("/health").GetAsync(); + response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync()); factoryCalled.ShouldBeTrue(); } } diff --git a/test/HealthChecks.Prometheus.Metrics.Tests/Functional/PrometheusResponseWriterTests.cs b/test/HealthChecks.Prometheus.Metrics.Tests/Functional/PrometheusResponseWriterTests.cs index 7e716e0a0c..4fc37a12dd 100644 --- a/test/HealthChecks.Prometheus.Metrics.Tests/Functional/PrometheusResponseWriterTests.cs +++ b/test/HealthChecks.Prometheus.Metrics.Tests/Functional/PrometheusResponseWriterTests.cs @@ -15,10 +15,10 @@ public async Task be_healthy_when_health_checks_are() }) .Configure(app => app.UseHealthChecksPrometheusExporter("/health"))); - using var response = await sut.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await sut.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); - var resultAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var resultAsString = await response.Content.ReadAsStringAsync(); resultAsString.ShouldContainCheckAndResult("fake", HealthStatus.Healthy); } @@ -33,10 +33,10 @@ public async Task be_unhealthy_and_return_503_when_health_checks_are() }) .Configure(app => app.UseHealthChecksPrometheusExporter("/health"))); - using var response = await sut.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await sut.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); - var resultAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var resultAsString = await response.Content.ReadAsStringAsync(); resultAsString.ShouldContainCheckAndResult("fake", HealthStatus.Unhealthy); } @@ -51,10 +51,10 @@ public async Task be_unhealthy_and_return_configured_status_code_when_health_che }) .Configure(app => app.UseHealthChecksPrometheusExporter("/health", options => options.ResultStatusCodes[HealthStatus.Unhealthy] = (int)HttpStatusCode.OK))); - using var response = await sut.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await sut.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); - var resultAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var resultAsString = await response.Content.ReadAsStringAsync(); resultAsString.ShouldContainCheckAndResult("fake", HealthStatus.Unhealthy); } } diff --git a/test/HealthChecks.Publisher.Seq.Tests/Functional/SeqPublisherTests.cs b/test/HealthChecks.Publisher.Seq.Tests/Functional/SeqPublisherTests.cs index 718644e98f..8f7aa5fb01 100644 --- a/test/HealthChecks.Publisher.Seq.Tests/Functional/SeqPublisherTests.cs +++ b/test/HealthChecks.Publisher.Seq.Tests/Functional/SeqPublisherTests.cs @@ -23,7 +23,7 @@ public async Task handle_trailing_slash_in_endpoint() // Create publisher and publish var publisher = new SeqPublisher(HttpClientFactory, options); - await publisher.PublishAsync(testReport, CancellationToken.None).ConfigureAwait(false); + await publisher.PublishAsync(testReport, CancellationToken.None); handler.Request.ShouldNotBeNull(); handler.Request.RequestUri.ShouldBe(expectedUri); @@ -68,7 +68,7 @@ public async Task apply_configure_action_on_raw_events() // Create publisher and publish var publisher = new SeqPublisher(HttpClientFactory, options); - await publisher.PublishAsync(testReport, CancellationToken.None).ConfigureAwait(false); + await publisher.PublishAsync(testReport, CancellationToken.None); handler.Request.ShouldNotBeNull(); handler.Request.Content.ShouldNotBeNull(); diff --git a/test/HealthChecks.RabbitMQ.Tests/Functional/RabbitHealthCheckTests.cs b/test/HealthChecks.RabbitMQ.Tests/Functional/RabbitHealthCheckTests.cs index da32688c20..07c09d7713 100644 --- a/test/HealthChecks.RabbitMQ.Tests/Functional/RabbitHealthCheckTests.cs +++ b/test/HealthChecks.RabbitMQ.Tests/Functional/RabbitHealthCheckTests.cs @@ -26,7 +26,7 @@ public async Task be_healthy_if_rabbitmq_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -52,7 +52,7 @@ public async Task be_healthy_if_rabbitmq_is_available_using_ssloption() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -76,7 +76,7 @@ public async Task be_unhealthy_if_rabbitmq_is_not_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -110,7 +110,7 @@ public async Task be_healthy_if_rabbitmq_is_available_using_iconnectionfactory() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -147,7 +147,7 @@ public async Task be_healthy_if_rabbitmq_is_available_using_iconnection() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -173,7 +173,7 @@ public async Task be_healthy_if_rabbitmq_is_available_and_specify_default_sslopt using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -207,7 +207,7 @@ public async Task be_not_crash_on_startup_when_rabbitmq_is_down_at_startup() using var server = new TestServer(webHostBuilder); - using var response1 = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response1 = await server.CreateRequest("/health").GetAsync(); response1.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -234,7 +234,7 @@ public async Task be_healthy_if_rabbitmq_is_available_using_iServiceProvider() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -266,8 +266,8 @@ public async Task two_rabbitmq_health_check() using var server = new TestServer(webHostBuilder); - using var response1 = await server.CreateRequest("/health1").GetAsync().ConfigureAwait(false); - using var response2 = await server.CreateRequest("/health2").GetAsync().ConfigureAwait(false); + using var response1 = await server.CreateRequest("/health1").GetAsync(); + using var response2 = await server.CreateRequest("/health2").GetAsync(); response1.StatusCode.ShouldBe(HttpStatusCode.OK); response2.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); @@ -293,7 +293,7 @@ public async Task should_respect_timeout() var healthCheckService = provider.GetRequiredService(); var start = DateTime.Now; using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)); - var report = await healthCheckService.CheckHealthAsync(cts.Token).ConfigureAwait(false); + var report = await healthCheckService.CheckHealthAsync(cts.Token); report.Status.ShouldBe(HealthStatus.Unhealthy); var end = DateTime.Now; (end - start).ShouldBeLessThan(TimeSpan.FromSeconds(10)); diff --git a/test/HealthChecks.RavenDb.Tests/Functional/RavenDbHealthCheckTests.cs b/test/HealthChecks.RavenDb.Tests/Functional/RavenDbHealthCheckTests.cs index 6732f517f3..79bb3fe69b 100644 --- a/test/HealthChecks.RavenDb.Tests/Functional/RavenDbHealthCheckTests.cs +++ b/test/HealthChecks.RavenDb.Tests/Functional/RavenDbHealthCheckTests.cs @@ -47,9 +47,9 @@ public async Task be_healthy_if_ravendb_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); - response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync()); } [Fact] @@ -77,9 +77,9 @@ public async Task be_healthy_if_ravendb_is_available_and_contains_specific_datab using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); - response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync()); } [Fact] @@ -94,7 +94,7 @@ public async Task be_unhealthy_if_ravendb_is_available_but_timeout_is_too_low() { _.Urls = _urls; _.Database = "Demo"; - _.RequestTimeout = TimeSpan.Zero; + _.RequestTimeout = TimeSpan.FromMilliseconds(0.001); }, tags: new string[] { "ravendb" }); }) .Configure(app => @@ -108,9 +108,9 @@ public async Task be_unhealthy_if_ravendb_is_available_but_timeout_is_too_low() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); - response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable, await response.Content.ReadAsStringAsync()); } [Fact] @@ -136,9 +136,9 @@ public async Task be_unhealthy_if_ravendb_is_not_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); - response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable, await response.Content.ReadAsStringAsync()); } [Fact] @@ -166,8 +166,8 @@ public async Task be_unhealthy_if_ravendb_is_available_but_database_doesnot_exis using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); - response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable, await response.Content.ReadAsStringAsync()); } } diff --git a/test/HealthChecks.RavenDb.Tests/Functional/RavenDbHealthCheckTestsSingleConnectionString.cs b/test/HealthChecks.RavenDb.Tests/Functional/RavenDbHealthCheckTestsSingleConnectionString.cs index 4fa5df7eee..4505499cdc 100644 --- a/test/HealthChecks.RavenDb.Tests/Functional/RavenDbHealthCheckTestsSingleConnectionString.cs +++ b/test/HealthChecks.RavenDb.Tests/Functional/RavenDbHealthCheckTestsSingleConnectionString.cs @@ -45,7 +45,7 @@ public async Task be_healthy_if_ravendb_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -70,7 +70,7 @@ public async Task be_healthy_if_ravendb_is_available_and_contains_specific_datab using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -97,7 +97,7 @@ public async Task be_unhealthy_if_ravendb_is_not_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -126,7 +126,7 @@ public async Task be_unhealthy_if_ravendb_is_available_but_database_doesnot_exis using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.Redis.Tests/Functional/RedisHealthCheckTests.cs b/test/HealthChecks.Redis.Tests/Functional/RedisHealthCheckTests.cs index 4dd1f17f92..8e3b9a632d 100644 --- a/test/HealthChecks.Redis.Tests/Functional/RedisHealthCheckTests.cs +++ b/test/HealthChecks.Redis.Tests/Functional/RedisHealthCheckTests.cs @@ -28,7 +28,7 @@ public async Task be_healthy_if_redis_is_available_with_connection_string() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -55,7 +55,7 @@ public async Task be_healthy_if_multiple_redis_are_available_with_connection_str using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -64,7 +64,7 @@ public async Task be_healthy_if_multiple_redis_are_available_with_connection_str public async Task be_healthy_if_redis_is_available_with_connection_multiplexer() { var connectionMultiplexer = await ConnectionMultiplexer - .ConnectAsync("localhost:6379,allowAdmin=true").ConfigureAwait(false); + .ConnectAsync("localhost:6379,allowAdmin=true"); var webHostBuilder = new WebHostBuilder() .ConfigureServices(services => @@ -82,7 +82,7 @@ public async Task be_healthy_if_redis_is_available_with_connection_multiplexer() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -91,7 +91,7 @@ public async Task be_healthy_if_redis_is_available_with_connection_multiplexer() public async Task be_healthy_if_multiple_redis_are_available_with_connection_multiplexer() { var connectionMultiplexer = await ConnectionMultiplexer - .ConnectAsync("localhost:6379,allowAdmin=true").ConfigureAwait(false); + .ConnectAsync("localhost:6379,allowAdmin=true"); var webHostBuilder = new WebHostBuilder() .ConfigureServices(services => @@ -112,7 +112,7 @@ public async Task be_healthy_if_multiple_redis_are_available_with_connection_mul using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -140,7 +140,7 @@ public async Task be_unhealthy_when_connection_multiplexer_factory_throws_on_con using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -164,7 +164,7 @@ public async Task be_unhealthy_if_redis_is_not_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -189,10 +189,10 @@ public async Task be_unhealthy_if_redis_is_not_available_within_specified_timeou using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); - (await response.Content.ReadAsStringAsync().ConfigureAwait(false)).ShouldContain("Healthcheck timed out"); + (await response.Content.ReadAsStringAsync()).ShouldContain("Healthcheck timed out"); } [Fact] @@ -214,7 +214,7 @@ public async Task not_every_IConnectionMultiplexer_is_ConnectionMultiplexer() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } diff --git a/test/HealthChecks.SignalR.Tests/Functional/SignalRHealthCheckTests.cs b/test/HealthChecks.SignalR.Tests/Functional/SignalRHealthCheckTests.cs index 3ae999b9e3..764e6a05cf 100644 --- a/test/HealthChecks.SignalR.Tests/Functional/SignalRHealthCheckTests.cs +++ b/test/HealthChecks.SignalR.Tests/Functional/SignalRHealthCheckTests.cs @@ -37,7 +37,7 @@ public async Task be_healthy_if_signalr_hub_is_available() server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); @@ -74,7 +74,7 @@ public async Task be_unhealthy_if_signalr_hub_is_unavailable() server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); diff --git a/test/HealthChecks.Solr.Tests/Functional/SolrHealthCheckTests.cs b/test/HealthChecks.Solr.Tests/Functional/SolrHealthCheckTests.cs index e359c86439..8a419a8dc4 100644 --- a/test/HealthChecks.Solr.Tests/Functional/SolrHealthCheckTests.cs +++ b/test/HealthChecks.Solr.Tests/Functional/SolrHealthCheckTests.cs @@ -24,8 +24,8 @@ public async Task be_healthy_if_solr_is_available() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); - response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + using var response = await server.CreateRequest("/health").GetAsync(); + response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync()); } [Fact] @@ -47,8 +47,8 @@ public async Task be_unhealthy_if_solr_ping_is_disabled() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); - response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + using var response = await server.CreateRequest("/health").GetAsync(); + response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable, await response.Content.ReadAsStringAsync()); } [Fact] @@ -70,7 +70,7 @@ public async Task be_unhealthy_if_solr_is_not_available() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); - response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + using var response = await server.CreateRequest("/health").GetAsync(); + response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable, await response.Content.ReadAsStringAsync()); } } diff --git a/test/HealthChecks.SqlServer.Tests/DependencyInjection/RegistrationTests.cs b/test/HealthChecks.SqlServer.Tests/DependencyInjection/RegistrationTests.cs index 1d4eb0af86..a33a6c7233 100644 --- a/test/HealthChecks.SqlServer.Tests/DependencyInjection/RegistrationTests.cs +++ b/test/HealthChecks.SqlServer.Tests/DependencyInjection/RegistrationTests.cs @@ -23,7 +23,7 @@ public void add_health_check_when_properly_configured() } [Fact] - public void invoke_beforeOpen_when_defined() + public async Task invoke_beforeOpen_when_defined() { var services = new ServiceCollection(); bool invoked = false; @@ -42,7 +42,7 @@ void beforeOpen(SqlConnection connection) var registration = options.Value.Registrations.First(); var check = registration.Factory(serviceProvider); - Record.ExceptionAsync(() => check.CheckHealthAsync(new HealthCheckContext())).GetAwaiter().GetResult(); + await Record.ExceptionAsync(() => check.CheckHealthAsync(new HealthCheckContext())); invoked.ShouldBeTrue(); } diff --git a/test/HealthChecks.SqlServer.Tests/Functional/SqlServerHealthCheckTests.cs b/test/HealthChecks.SqlServer.Tests/Functional/SqlServerHealthCheckTests.cs index 029c26ec59..8a61bd7870 100644 --- a/test/HealthChecks.SqlServer.Tests/Functional/SqlServerHealthCheckTests.cs +++ b/test/HealthChecks.SqlServer.Tests/Functional/SqlServerHealthCheckTests.cs @@ -25,7 +25,7 @@ public async Task be_healthy_if_sqlServer_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -49,7 +49,7 @@ public async Task be_unhealthy_if_sqlServer_is_not_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -75,7 +75,7 @@ public async Task be_unhealthy_if_sqlquery_spec_is_not_valid() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.Sqlite.Tests/Functional/SqliteHealthCheckTests.cs b/test/HealthChecks.Sqlite.Tests/Functional/SqliteHealthCheckTests.cs index 64f087afc3..8553bedf77 100644 --- a/test/HealthChecks.Sqlite.Tests/Functional/SqliteHealthCheckTests.cs +++ b/test/HealthChecks.Sqlite.Tests/Functional/SqliteHealthCheckTests.cs @@ -23,7 +23,7 @@ public async void be_healthy_when_sqlite_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -47,7 +47,7 @@ public async Task be_unhealthy_when_sqlite_is_unavailable() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -71,7 +71,7 @@ public async void be_unhealthy_when_sqlquery_is_not_valid() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.System.Tests/Functional/DiskStorageHealthCheckTests.cs b/test/HealthChecks.System.Tests/Functional/DiskStorageHealthCheckTests.cs index 57a763e72a..80c5ce3d58 100644 --- a/test/HealthChecks.System.Tests/Functional/DiskStorageHealthCheckTests.cs +++ b/test/HealthChecks.System.Tests/Functional/DiskStorageHealthCheckTests.cs @@ -30,7 +30,7 @@ public async Task be_healthy_when_disks_have_more_free_space_than_configured() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.EnsureSuccessStatusCode(); } @@ -58,7 +58,7 @@ public async Task be_unhealthy_when_a_disk_has_less_free_space_than_configured() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -81,7 +81,7 @@ public async Task be_unhealthy_when_a_configured_disk_does_not_exist() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.System.Tests/Functional/FolderHealthCheckTests.cs b/test/HealthChecks.System.Tests/Functional/FolderHealthCheckTests.cs index 917ca64b73..02249415cd 100644 --- a/test/HealthChecks.System.Tests/Functional/FolderHealthCheckTests.cs +++ b/test/HealthChecks.System.Tests/Functional/FolderHealthCheckTests.cs @@ -23,7 +23,7 @@ public async Task be_healthy_if_folder_is_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -49,7 +49,7 @@ public async Task be_healthy_if_no_folder_provided() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -73,7 +73,7 @@ public async Task be_unhealthy_if_folder_is_not_available() using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } diff --git a/test/HealthChecks.System.Tests/Functional/ProcessHealthChecksTests.cs b/test/HealthChecks.System.Tests/Functional/ProcessHealthChecksTests.cs index f23707b4f9..8628607fad 100644 --- a/test/HealthChecks.System.Tests/Functional/ProcessHealthChecksTests.cs +++ b/test/HealthChecks.System.Tests/Functional/ProcessHealthChecksTests.cs @@ -26,7 +26,7 @@ public async Task be_healthy_when_the_process_exists_and_is_running() }); using var server = new TestServer(webhostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -48,7 +48,7 @@ public async Task be_unhealthy_when_the_process_is_not_running() }); using var server = new TestServer(webhostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -70,7 +70,7 @@ public async Task be_unhealthy_when_the_predicate_throws_exception() }); using var server = new TestServer(webhostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } } diff --git a/test/HealthChecks.UI.Client.Tests/HealthChecks.UI.Client.Tests.csproj b/test/HealthChecks.UI.Client.Tests/HealthChecks.UI.Client.Tests.csproj index 1325f519c1..5a1aa313a6 100644 --- a/test/HealthChecks.UI.Client.Tests/HealthChecks.UI.Client.Tests.csproj +++ b/test/HealthChecks.UI.Client.Tests/HealthChecks.UI.Client.Tests.csproj @@ -1,5 +1,9 @@ + + net8.0 + + diff --git a/test/HealthChecks.UI.Client.Tests/UIResponseWriterTests.cs b/test/HealthChecks.UI.Client.Tests/UIResponseWriterTests.cs index 3dfd77ea32..b3b5f7e42d 100644 --- a/test/HealthChecks.UI.Client.Tests/UIResponseWriterTests.cs +++ b/test/HealthChecks.UI.Client.Tests/UIResponseWriterTests.cs @@ -21,11 +21,11 @@ public async Task should_response_with_obfuscated_exception_when_exception_messa }; var report = new HealthReport(entries, TimeSpan.FromSeconds(1)); - await UIResponseWriter.WriteHealthCheckUIResponseNoExceptionDetails(httpContext, report).ConfigureAwait(false); + await UIResponseWriter.WriteHealthCheckUIResponseNoExceptionDetails(httpContext, report); // reset pointer to the beginning httpContext.Response.Body.Seek(0, SeekOrigin.Begin); - var healthReport = await JsonSerializer.DeserializeAsync(httpContext.Response.Body, CreateJsonOptions()).ConfigureAwait(false); + var healthReport = await JsonSerializer.DeserializeAsync(httpContext.Response.Body, CreateJsonOptions()); httpContext.Response.ContentType.ShouldBe("application/json"); healthReport.ShouldNotBeNull().Entries.ShouldHaveSingleItem(); @@ -46,12 +46,12 @@ public async Task should_not_encode_unicode_characters(string healthReportKey) }; var report = new HealthReport(entries, TimeSpan.FromSeconds(1)); - await UIResponseWriter.WriteHealthCheckUIResponse(httpContext, report).ConfigureAwait(false); + await UIResponseWriter.WriteHealthCheckUIResponse(httpContext, report); httpContext.Response.Body.Seek(0, SeekOrigin.Begin); var responseStreamReader = new StreamReader(httpContext.Response.Body); - var responseAsText = await responseStreamReader.ReadToEndAsync().ConfigureAwait(false); + var responseAsText = await responseStreamReader.ReadToEndAsync(); responseAsText.ShouldContain(healthReportKey); } diff --git a/test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj b/test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj index 6359960d8b..d6c0a2b250 100644 --- a/test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj +++ b/test/HealthChecks.UI.Data.Tests/HealthChecks.UI.Data.Tests.csproj @@ -1,7 +1,11 @@ + + net8.0 + + - + diff --git a/test/HealthChecks.UI.Data.Tests/HealthChecksDbTests.cs b/test/HealthChecks.UI.Data.Tests/HealthChecksDbTests.cs index 1af2ddae8e..f2bd4c7df0 100644 --- a/test/HealthChecks.UI.Data.Tests/HealthChecksDbTests.cs +++ b/test/HealthChecks.UI.Data.Tests/HealthChecksDbTests.cs @@ -11,10 +11,10 @@ public async Task HealthChecksDb_Primitive_Test() services.AddDbContext(b => b.UseInMemoryDatabase("")); using var provider = services.BuildServiceProvider(); var db = provider.GetRequiredService(); - (await db.Configurations.ToListAsync().ConfigureAwait(false)).Count.ShouldBe(0); - (await db.Executions.ToListAsync().ConfigureAwait(false)).Count.ShouldBe(0); - (await db.Failures.ToListAsync().ConfigureAwait(false)).Count.ShouldBe(0); - (await db.HealthCheckExecutionEntries.ToListAsync().ConfigureAwait(false)).Count.ShouldBe(0); - (await db.HealthCheckExecutionHistories.ToListAsync().ConfigureAwait(false)).Count.ShouldBe(0); + (await db.Configurations.ToListAsync()).Count.ShouldBe(0); + (await db.Executions.ToListAsync()).Count.ShouldBe(0); + (await db.Failures.ToListAsync()).Count.ShouldBe(0); + (await db.HealthCheckExecutionEntries.ToListAsync()).Count.ShouldBe(0); + (await db.HealthCheckExecutionHistories.ToListAsync()).Count.ShouldBe(0); } } diff --git a/test/HealthChecks.UI.Tests/Functional/Configuration/UIConfigurationTests.cs b/test/HealthChecks.UI.Tests/Functional/Configuration/UIConfigurationTests.cs index 93dc8cd957..f15bb27d0d 100644 --- a/test/HealthChecks.UI.Tests/Functional/Configuration/UIConfigurationTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/Configuration/UIConfigurationTests.cs @@ -329,8 +329,8 @@ public async Task support_configuring_page_title() var server = new TestServer(builder); var options = server.Services.GetRequiredService>().Value; - var response = await server.CreateRequest(options.UIPath).GetAsync().ConfigureAwait(false); - var html = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var response = await server.CreateRequest(options.UIPath).GetAsync(); + var html = await response.Content.ReadAsStringAsync(); html.ShouldContain($"{pageTitle}"); } diff --git a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/InMemoryStorageProviderTests.cs b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/InMemoryStorageProviderTests.cs index ffffbe8fcf..0df030f029 100644 --- a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/InMemoryStorageProviderTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/InMemoryStorageProviderTests.cs @@ -45,7 +45,7 @@ public async Task seed_database_and_serve_stored_executions() hostReset.Wait(ProviderTestHelper.DefaultHostTimeout); var context = host.Services.GetRequiredService(); - var configurations = await context.Configurations.ToListAsync().ConfigureAwait(false); + var configurations = await context.Configurations.ToListAsync(); var host1 = ProviderTestHelper.Endpoints[0]; configurations[0].Name.ShouldBe(host1.Name); @@ -55,7 +55,7 @@ public async Task seed_database_and_serve_stored_executions() collectorReset.Wait(ProviderTestHelper.DefaultCollectorTimeout); - var report = await client.GetAsJson>("/healthchecks-api").ConfigureAwait(false); + var report = await client.GetAsJson>("/healthchecks-api"); report.First().Name.ShouldBe(host1.Name); } } diff --git a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/MySqlStorageProviderTests.cs b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/MySqlStorageProviderTests.cs index c80981c562..631f52061c 100644 --- a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/MySqlStorageProviderTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/MySqlStorageProviderTests.cs @@ -45,7 +45,7 @@ public async Task seed_database_and_serve_stored_executions() hostReset.Wait(ProviderTestHelper.DefaultHostTimeout); var context = host.Services.GetRequiredService(); - var configurations = await context.Configurations.ToListAsync().ConfigureAwait(false); + var configurations = await context.Configurations.ToListAsync(); var host1 = ProviderTestHelper.Endpoints[0]; configurations[0].Name.ShouldBe(host1.Name); @@ -55,7 +55,7 @@ public async Task seed_database_and_serve_stored_executions() collectorReset.Wait(ProviderTestHelper.DefaultCollectorTimeout); - var report = await client.GetAsJson>("/healthchecks-api").ConfigureAwait(false); + var report = await client.GetAsJson>("/healthchecks-api"); report.First().Name.ShouldBe(host1.Name); } } diff --git a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/PostgreSqlStorageProviderTests.cs b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/PostgreSqlStorageProviderTests.cs index 9e8e5bc84f..67ad42f68b 100644 --- a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/PostgreSqlStorageProviderTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/PostgreSqlStorageProviderTests.cs @@ -46,7 +46,7 @@ public async Task seed_database_and_serve_stored_executions() hostReset.Wait(ProviderTestHelper.DefaultHostTimeout); var context = host.Services.GetRequiredService(); - var configurations = await context.Configurations.ToListAsync().ConfigureAwait(false); + var configurations = await context.Configurations.ToListAsync(); var host1 = ProviderTestHelper.Endpoints[0]; configurations[0].Name.ShouldBe(host1.Name); @@ -56,7 +56,7 @@ public async Task seed_database_and_serve_stored_executions() collectorReset.Wait(ProviderTestHelper.DefaultCollectorTimeout); - var report = await client.GetAsJson>("/healthchecks-api").ConfigureAwait(false); + var report = await client.GetAsJson>("/healthchecks-api"); report.First().Name.ShouldBe(host1.Name); } } diff --git a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqlServerStorageProviderTests.cs b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqlServerStorageProviderTests.cs index 2f77e5183e..b7c01c060c 100644 --- a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqlServerStorageProviderTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqlServerStorageProviderTests.cs @@ -45,7 +45,7 @@ public async Task seed_database_and_serve_stored_executions() hostReset.Wait(ProviderTestHelper.DefaultHostTimeout); var context = host.Services.GetRequiredService(); - var configurations = await context.Configurations.ToListAsync().ConfigureAwait(false); + var configurations = await context.Configurations.ToListAsync(); var host1 = ProviderTestHelper.Endpoints[0]; configurations[0].Name.ShouldBe(host1.Name); @@ -55,7 +55,7 @@ public async Task seed_database_and_serve_stored_executions() collectorReset.Wait(ProviderTestHelper.DefaultCollectorTimeout); - var report = await client.GetAsJson>("/healthchecks-api").ConfigureAwait(false); + var report = await client.GetAsJson>("/healthchecks-api"); report.First().Name.ShouldBe(host1.Name); } } diff --git a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqliteStorageProviderTests.cs b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqliteStorageProviderTests.cs index 7d660d380f..b96abae896 100644 --- a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqliteStorageProviderTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/SqliteStorageProviderTests.cs @@ -45,7 +45,7 @@ public async Task seed_database_and_serve_stored_executions() hostReset.Wait(ProviderTestHelper.DefaultHostTimeout); var context = host.Services.GetRequiredService(); - var configurations = await context.Configurations.ToListAsync().ConfigureAwait(false); + var configurations = await context.Configurations.ToListAsync(); var host1 = ProviderTestHelper.Endpoints[0]; @@ -56,7 +56,7 @@ public async Task seed_database_and_serve_stored_executions() collectorReset.Wait(ProviderTestHelper.DefaultCollectorTimeout); - var report = await client.GetAsJson>("/healthchecks-api").ConfigureAwait(false); + var report = await client.GetAsJson>("/healthchecks-api"); report.First().Name.ShouldBe(host1.Name); } } diff --git a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/UpdateConfigurationTests.cs b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/UpdateConfigurationTests.cs index 013071c4b6..c2c8f612fa 100644 --- a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/UpdateConfigurationTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/UpdateConfigurationTests.cs @@ -36,7 +36,7 @@ public async Task update_healthchecks_uris_when_configuration_exists() hostReset.Wait(); var context = host1.Services.GetRequiredService(); - var configurations = await context.Configurations.ToListAsync().ConfigureAwait(false); + var configurations = await context.Configurations.ToListAsync(); configurations[0].Name.ShouldBe(endpointName); configurations[0].Uri.ShouldBe(endpointUri); @@ -46,7 +46,7 @@ public async Task update_healthchecks_uris_when_configuration_exists() hostReset.Wait(); context = host2.Services.GetRequiredService(); - configurations = await context.Configurations.ToListAsync().ConfigureAwait(false); + configurations = await context.Configurations.ToListAsync(); configurations[0].Name.ShouldBe(endpointName); configurations[0].Uri.ShouldBe(updatedEndpointUri); diff --git a/test/HealthChecks.UI.Tests/Functional/UIApiRequestLimitingTests.cs b/test/HealthChecks.UI.Tests/Functional/UIApiRequestLimitingTests.cs index a4c1f4812e..7bc1b116d0 100644 --- a/test/HealthChecks.UI.Tests/Functional/UIApiRequestLimitingTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/UIApiRequestLimitingTests.cs @@ -48,7 +48,7 @@ public async Task should_return_too_many_requests_status_code_when_exceding_conf .Select(_ => server.CreateRequest(new Configuration.Options().ApiPath).GetAsync()) .ToList(); - var responses = await Task.WhenAll(tasks).ConfigureAwait(false); + var responses = await Task.WhenAll(tasks); responses.Where(r => r.StatusCode == HttpStatusCode.TooManyRequests).Count().ShouldBe(responses.Length - maxActiveRequests); responses.Where(r => r.StatusCode == HttpStatusCode.OK).Count().ShouldBe(maxActiveRequests); @@ -95,7 +95,7 @@ public async Task should_return_too_many_requests_status_using_default_server_ma .Select(_ => server.CreateRequest(new Configuration.Options().ApiPath).GetAsync()) .ToList(); - var responses = await Task.WhenAll(tasks).ConfigureAwait(false); + var responses = await Task.WhenAll(tasks); responses.Where(r => r.StatusCode == HttpStatusCode.TooManyRequests).Count().ShouldBe(responses.Length - serverSettings.ApiMaxActiveRequests); responses.Where(r => r.StatusCode == HttpStatusCode.OK).Count().ShouldBe(serverSettings.ApiMaxActiveRequests); diff --git a/test/HealthChecks.UI.Tests/HealthChecks.UI.Tests.csproj b/test/HealthChecks.UI.Tests/HealthChecks.UI.Tests.csproj index 28f33106c3..1b17187438 100644 --- a/test/HealthChecks.UI.Tests/HealthChecks.UI.Tests.csproj +++ b/test/HealthChecks.UI.Tests/HealthChecks.UI.Tests.csproj @@ -1,7 +1,7 @@ - $(NoWarn);AD0001 + net8.0 diff --git a/test/HealthChecks.Uris.Tests/Functional/UrisHealthCheckTests.cs b/test/HealthChecks.Uris.Tests/Functional/UrisHealthCheckTests.cs index c4997d9ea9..ac0e7839c6 100644 --- a/test/HealthChecks.Uris.Tests/Functional/UrisHealthCheckTests.cs +++ b/test/HealthChecks.Uris.Tests/Functional/UrisHealthCheckTests.cs @@ -60,7 +60,7 @@ public async Task be_healthy_if_uri_is_available() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.OK); } @@ -89,8 +89,8 @@ public async Task be_healthy_if_method_is_available() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); - response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + using var response = await server.CreateRequest("/health").GetAsync(); + response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync()); } [Fact] @@ -113,7 +113,7 @@ public async Task be_unhealthy_if_uri_is_not_available() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -139,7 +139,7 @@ public async Task be_unhealthy_if_status_code_is_error(int statusCode) }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -165,7 +165,7 @@ public async Task be_unhealthy_if_request_is_timeout() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -196,7 +196,7 @@ public async Task be_unhealthy_if_request_is_timeout_using_default_timeout() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } @@ -225,8 +225,8 @@ public async Task be_healthy_if_request_success_and_timeout_is_configured() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); - response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + using var response = await server.CreateRequest("/health").GetAsync(); + response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync()); } [Fact] @@ -258,8 +258,8 @@ public async Task be_healthy_if_request_success_and_default_timeout_is_configure }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); - response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + using var response = await server.CreateRequest("/health").GetAsync(); + response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync()); } [Fact] @@ -285,8 +285,8 @@ public async Task be_healthy_if_request_succeeds_and_expected_response_matches() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); - response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + using var response = await server.CreateRequest("/health").GetAsync(); + response.StatusCode.ShouldBe(HttpStatusCode.OK, await response.Content.ReadAsStringAsync()); } [Fact] @@ -312,7 +312,7 @@ public async Task be_unhealthy_if_request_succeeds_and_expected_response_fails() }); using var server = new TestServer(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(HttpStatusCode.ServiceUnavailable); } } diff --git a/test/HealthChecks.Uris.Tests/Functional/UrisHealthcheckTests2.cs b/test/HealthChecks.Uris.Tests/Functional/UrisHealthcheckTests2.cs index 15923efd5c..7eb64020e3 100644 --- a/test/HealthChecks.Uris.Tests/Functional/UrisHealthcheckTests2.cs +++ b/test/HealthChecks.Uris.Tests/Functional/UrisHealthcheckTests2.cs @@ -27,7 +27,7 @@ public async Task use_configured_http_client_and_handler_with_default_overload() var registration = options.Value.Registrations.First(); var check = registration.Factory(sp); - var result = await check.CheckHealthAsync(new HealthCheckContext { Registration = registration }).ConfigureAwait(false); + var result = await check.CheckHealthAsync(new HealthCheckContext { Registration = registration }); result.Status.ShouldBe(HealthStatus.Healthy); using var client = sp.GetRequiredService().CreateClient(hcname); @@ -59,7 +59,7 @@ public async Task use_configured_http_client_and_handler_when_configuring_method var registration = options.Value.Registrations.First(); var check = registration.Factory(sp); using var client = sp.GetRequiredService().CreateClient(hcname); - var result = await check.CheckHealthAsync(new HealthCheckContext { Registration = registration }).ConfigureAwait(false); + var result = await check.CheckHealthAsync(new HealthCheckContext { Registration = registration }); result.Status.ShouldBe(HealthStatus.Unhealthy); client.DefaultRequestHeaders.Any(s => s.Key == headerName).ShouldBeTrue(); @@ -83,7 +83,7 @@ public async Task use_configured_http_client_and_handler_when_using_setup_method var registration = options.Value.Registrations.First(); var check = registration.Factory(sp); using var client = sp.GetRequiredService().CreateClient(hcname); - var result = await check.CheckHealthAsync(new HealthCheckContext { Registration = registration }).ConfigureAwait(false); + var result = await check.CheckHealthAsync(new HealthCheckContext { Registration = registration }); client.DefaultRequestHeaders.Any(s => s.Key == "MockHeader").ShouldBeTrue(); result.Status.ShouldBe(HealthStatus.Unhealthy); diff --git a/test/HealthChecks.Uris.Tests/HealthChecks.Uris.Tests.csproj b/test/HealthChecks.Uris.Tests/HealthChecks.Uris.Tests.csproj index 60f5e9d389..e0ce935650 100644 --- a/test/HealthChecks.Uris.Tests/HealthChecks.Uris.Tests.csproj +++ b/test/HealthChecks.Uris.Tests/HealthChecks.Uris.Tests.csproj @@ -1,7 +1,11 @@ + + net8.0 + + - + diff --git a/test/_SHARED/ApiApprovalTests.cs b/test/_SHARED/ApiApprovalTests.cs index 241ace9b64..a79a63087d 100644 --- a/test/_SHARED/ApiApprovalTests.cs +++ b/test/_SHARED/ApiApprovalTests.cs @@ -17,6 +17,7 @@ public void public_api_should_not_change_unintentionally() var nameToFind = string.Join(".", nameItems.SkipLast(1)); var asmForTest = dependencies .Select(Assembly.Load) + .Where(a => !string.Equals(a.FullName, "Microsoft.Data.SqlClient, Version=5.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5", StringComparison.OrdinalIgnoreCase)) // https://github.com/dotnet/SqlClient/issues/1930#issuecomment-1814595368 .Where(asm => asm.GetTypes().Any(type => type.Name == "ApiMarker") && asm.GetName().Name!.Equals(nameToFind, StringComparison.InvariantCultureIgnoreCase)) .Single(); diff --git a/test/_SHARED/ConformanceTests.cs b/test/_SHARED/ConformanceTests.cs index 2b529d466f..6d2aab48fd 100644 --- a/test/_SHARED/ConformanceTests.cs +++ b/test/_SHARED/ConformanceTests.cs @@ -82,7 +82,7 @@ public async Task ReturnsProvidedFailureStatusWhenConnectionCanNotBeMade(HealthS using TestServer server = new(webHostBuilder); - using var response = await server.CreateRequest("/health").GetAsync().ConfigureAwait(false); + using var response = await server.CreateRequest("/health").GetAsync(); response.StatusCode.ShouldBe(failureStatus == HealthStatus.Unhealthy ? HttpStatusCode.ServiceUnavailable : HttpStatusCode.OK); }