diff --git a/src/ServiceControl.AcceptanceTesting/NServiceBusAcceptanceTest.cs b/src/ServiceControl.AcceptanceTesting/NServiceBusAcceptanceTest.cs
index b510e326ec..93614c2dfb 100644
--- a/src/ServiceControl.AcceptanceTesting/NServiceBusAcceptanceTest.cs
+++ b/src/ServiceControl.AcceptanceTesting/NServiceBusAcceptanceTest.cs
@@ -13,6 +13,7 @@
///
[TestFixture]
[FixtureLifeCycle(LifeCycle.InstancePerTestCase)]
+ [CancelAfter(180_000)]
public abstract partial class NServiceBusAcceptanceTest
{
[SetUp]
diff --git a/src/ServiceControl.AcceptanceTests.PostgreSql/ServiceControl.AcceptanceTests.PostgreSql.csproj b/src/ServiceControl.AcceptanceTests.PostgreSql/ServiceControl.AcceptanceTests.PostgreSql.csproj
index 56a4054a16..95103528ce 100644
--- a/src/ServiceControl.AcceptanceTests.PostgreSql/ServiceControl.AcceptanceTests.PostgreSql.csproj
+++ b/src/ServiceControl.AcceptanceTests.PostgreSql/ServiceControl.AcceptanceTests.PostgreSql.csproj
@@ -3,6 +3,9 @@
net10.0
PostgreSql
+
+ $(NoWarn);NUnit1027
diff --git a/src/ServiceControl.AcceptanceTests.RavenDB/Monitoring/CustomChecks/When_a_persister_check_fails.cs b/src/ServiceControl.AcceptanceTests.RavenDB/Monitoring/CustomChecks/When_a_persister_check_fails.cs
index a635fda807..261ebe27bb 100644
--- a/src/ServiceControl.AcceptanceTests.RavenDB/Monitoring/CustomChecks/When_a_persister_check_fails.cs
+++ b/src/ServiceControl.AcceptanceTests.RavenDB/Monitoring/CustomChecks/When_a_persister_check_fails.cs
@@ -2,6 +2,7 @@ namespace ServiceControl.AcceptanceTests.RavenDB.Monitoring.CustomChecks
{
using System;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -30,7 +31,7 @@ public void SetupIngestion() =>
RavenPersisterSettings PersisterSettings => (RavenPersisterSettings)Settings.PersisterSpecificSettings;
[Test]
- public async Task Forced_failure_is_classified_internal()
+ public async Task Forced_failure_is_classified_internal(CancellationToken cancellationToken = default)
{
CustomCheckView ingestionCheck = null;
@@ -49,7 +50,7 @@ await Define()
ingestionCheck = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests.RavenDB/Monitoring/CustomChecks/When_critical_storage_threshold_reached.cs b/src/ServiceControl.AcceptanceTests.RavenDB/Monitoring/CustomChecks/When_critical_storage_threshold_reached.cs
index 6067ea881e..db19729ca0 100644
--- a/src/ServiceControl.AcceptanceTests.RavenDB/Monitoring/CustomChecks/When_critical_storage_threshold_reached.cs
+++ b/src/ServiceControl.AcceptanceTests.RavenDB/Monitoring/CustomChecks/When_critical_storage_threshold_reached.cs
@@ -2,6 +2,7 @@ namespace ServiceControl.AcceptanceTests.RavenDB.Monitoring.CustomChecks
{
using System;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -26,7 +27,7 @@ public void SetupIngestion() =>
RavenPersisterSettings PersisterSettings => (RavenPersisterSettings)Settings.PersisterSpecificSettings;
[Test]
- public async Task Should_stop_ingestion() =>
+ public async Task Should_stop_ingestion(CancellationToken cancellationToken = default) =>
await Define()
.WithEndpoint(b => b
.When(context =>
@@ -45,10 +46,10 @@ await Define()
)
.DoNotFailOnErrorMessages())
.Done(async c => await this.TryGetSingle("/api/errors") == false)
- .Run();
+ .Run(cancellationToken);
[Test]
- public async Task Should_stop_ingestion_and_resume_when_more_space_is_available()
+ public async Task Should_stop_ingestion_and_resume_when_more_space_is_available(CancellationToken cancellationToken = default)
{
var ingestionShutdown = false;
@@ -76,7 +77,7 @@ await Define()
})
.DoNotFailOnErrorMessages())
.Done(async c => await this.TryGetSingle("/api/errors"))
- .Run();
+ .Run(cancellationToken);
}
public class Sender : EndpointConfigurationBuilder
diff --git a/src/ServiceControl.AcceptanceTests.RavenDB/Recoverability/MessageFailures/When_a_failed_message_is_retried.cs b/src/ServiceControl.AcceptanceTests.RavenDB/Recoverability/MessageFailures/When_a_failed_message_is_retried.cs
index 95a133bd5b..7d6f7cb64d 100644
--- a/src/ServiceControl.AcceptanceTests.RavenDB/Recoverability/MessageFailures/When_a_failed_message_is_retried.cs
+++ b/src/ServiceControl.AcceptanceTests.RavenDB/Recoverability/MessageFailures/When_a_failed_message_is_retried.cs
@@ -21,7 +21,7 @@
class When_a_failed_message_is_retried : AcceptanceTest
{
[Test]
- public async Task Should_remove_failedmessageretries_when_retrying_groups()
+ public async Task Should_remove_failedmessageretries_when_retrying_groups(CancellationToken cancellationToken = default)
{
FailedMessageRetriesCountReponse failedMessageRetries = null;
@@ -58,13 +58,13 @@ await Define()
return false;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(failedMessageRetries.Count, Is.EqualTo(0), "FailedMessageRetries not removed");
}
[Test]
- public async Task Should_remove_failedmessageretries_when_retrying_individual_messages()
+ public async Task Should_remove_failedmessageretries_when_retrying_individual_messages(CancellationToken cancellationToken = default)
{
FailedMessageRetriesCountReponse failedMessageRetries = null;
@@ -99,13 +99,13 @@ await Define()
return false;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(failedMessageRetries.Count, Is.EqualTo(0), "FailedMessageRetries not removed");
}
[Test]
- public async Task Should_remove_UnacknowledgedOperation_when_retrying_individual_messages()
+ public async Task Should_remove_UnacknowledgedOperation_when_retrying_individual_messages(CancellationToken cancellationToken = default)
{
RetryHistory retryHistory = null;
@@ -140,13 +140,13 @@ await Define()
return false;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(retryHistory.UnacknowledgedOperations, Is.Empty, "Unucknowledged retry operation not removed");
}
[Test]
- public async Task Should_remove_failedmessageretries_after_expiration_process_passes()
+ public async Task Should_remove_failedmessageretries_after_expiration_process_passes(CancellationToken cancellationToken = default)
{
FailedMessageRetriesCountReponse failedMessageRetries = null;
@@ -186,7 +186,7 @@ await Define()
return false;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(failedMessageRetries.Count, Is.EqualTo(0), "FailedMessageRetries not removed");
}
diff --git a/src/ServiceControl.AcceptanceTests.RavenDB/Recoverability/MessageFailures/When_a_message_fails_to_import.cs b/src/ServiceControl.AcceptanceTests.RavenDB/Recoverability/MessageFailures/When_a_message_fails_to_import.cs
index e1749990c0..20baa10cf4 100644
--- a/src/ServiceControl.AcceptanceTests.RavenDB/Recoverability/MessageFailures/When_a_message_fails_to_import.cs
+++ b/src/ServiceControl.AcceptanceTests.RavenDB/Recoverability/MessageFailures/When_a_message_fails_to_import.cs
@@ -22,7 +22,7 @@
class When_a_message_fails_to_import : AcceptanceTest
{
[Test]
- public async Task It_can_be_reimported()
+ public async Task It_can_be_reimported(CancellationToken cancellationToken = default)
{
CustomizeHostBuilder = hostBuilder =>
{
@@ -66,7 +66,7 @@ public async Task It_can_be_reimported()
return await this.TryGet($"/api/errors/{c.UniqueMessageId}") && c.ErrorForwarded;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests.RavenDB/Recoverability/MessageFailures/When_body_search_is_disabled.cs b/src/ServiceControl.AcceptanceTests.RavenDB/Recoverability/MessageFailures/When_body_search_is_disabled.cs
index 42e1d71e37..3be0ab22d0 100644
--- a/src/ServiceControl.AcceptanceTests.RavenDB/Recoverability/MessageFailures/When_body_search_is_disabled.cs
+++ b/src/ServiceControl.AcceptanceTests.RavenDB/Recoverability/MessageFailures/When_body_search_is_disabled.cs
@@ -1,6 +1,7 @@
namespace ServiceControl.AcceptanceTests.RavenDB.Recoverability.MessageFailures
{
using System;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -15,7 +16,7 @@ namespace ServiceControl.AcceptanceTests.RavenDB.Recoverability.MessageFailures
class When_body_search_is_disabled : AcceptanceTest
{
[Test]
- public async Task Should_not_be_found()
+ public async Task Should_not_be_found(CancellationToken cancellationToken = default)
{
SetSettings = settings => settings.PersisterSpecificSettings.EnableFullTextSearchOnBodies = false;
@@ -42,7 +43,7 @@ public async Task Should_not_be_found()
c.MessageFound = await this.TryGetMany($"/api/messages/search/{searchString}");
return true;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests.RavenDB/ServiceControl.AcceptanceTests.RavenDB.csproj b/src/ServiceControl.AcceptanceTests.RavenDB/ServiceControl.AcceptanceTests.RavenDB.csproj
index 33be55ce4f..dd3b3075da 100644
--- a/src/ServiceControl.AcceptanceTests.RavenDB/ServiceControl.AcceptanceTests.RavenDB.csproj
+++ b/src/ServiceControl.AcceptanceTests.RavenDB/ServiceControl.AcceptanceTests.RavenDB.csproj
@@ -3,6 +3,9 @@
net10.0
Raven
+
+ $(NoWarn);NUnit1027
diff --git a/src/ServiceControl.AcceptanceTests.SqlServer/ServiceControl.AcceptanceTests.SqlServer.csproj b/src/ServiceControl.AcceptanceTests.SqlServer/ServiceControl.AcceptanceTests.SqlServer.csproj
index ce485ced3f..91c2882e29 100644
--- a/src/ServiceControl.AcceptanceTests.SqlServer/ServiceControl.AcceptanceTests.SqlServer.csproj
+++ b/src/ServiceControl.AcceptanceTests.SqlServer/ServiceControl.AcceptanceTests.SqlServer.csproj
@@ -3,6 +3,9 @@
net10.0
SqlServer
+
+ $(NoWarn);NUnit1027
diff --git a/src/ServiceControl.AcceptanceTests/EventLogs/When_the_event_log_is_polled_with_an_etag.cs b/src/ServiceControl.AcceptanceTests/EventLogs/When_the_event_log_is_polled_with_an_etag.cs
index c8e59f7bce..b52a27bd73 100644
--- a/src/ServiceControl.AcceptanceTests/EventLogs/When_the_event_log_is_polled_with_an_etag.cs
+++ b/src/ServiceControl.AcceptanceTests/EventLogs/When_the_event_log_is_polled_with_an_etag.cs
@@ -5,6 +5,7 @@ namespace ServiceControl.AcceptanceTests.EventLogs
using System.Net;
using System.Net.Http;
using System.Net.Http.Json;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -18,7 +19,7 @@ namespace ServiceControl.AcceptanceTests.EventLogs
class When_the_event_log_is_polled_with_an_etag : AcceptanceTest
{
[Test]
- public async Task Should_answer_not_modified_only_for_the_current_etag()
+ public async Task Should_answer_not_modified_only_for_the_current_etag(CancellationToken cancellationToken = default)
{
string etag = null;
HttpStatusCode currentEtagStatus = default;
@@ -70,7 +71,7 @@ await Define()
return true;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Licensing/When_creating_a_usage_report_on_a_broker_transport.cs b/src/ServiceControl.AcceptanceTests/Licensing/When_creating_a_usage_report_on_a_broker_transport.cs
index 2027647c27..af4ac94629 100644
--- a/src/ServiceControl.AcceptanceTests/Licensing/When_creating_a_usage_report_on_a_broker_transport.cs
+++ b/src/ServiceControl.AcceptanceTests/Licensing/When_creating_a_usage_report_on_a_broker_transport.cs
@@ -6,6 +6,7 @@ namespace ServiceControl.AcceptanceTests.Licensing
using System.IO.Compression;
using System.Linq;
using System.Text.Json;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -27,7 +28,7 @@ namespace ServiceControl.AcceptanceTests.Licensing
class When_creating_a_usage_report_on_a_broker_transport : AcceptanceTest
{
[Test]
- public async Task Should_report_what_the_broker_measured()
+ public async Task Should_report_what_the_broker_measured(CancellationToken cancellationToken = default)
{
ReportGenerationState reportState = null;
ThroughputConnectionSettings connectionSettings = null;
@@ -76,7 +77,7 @@ await Define()
report = ReadReport(archive);
})
.Done(_ => true)
- .Run();
+ .Run(cancellationToken);
var reportData = report.RootElement.GetProperty("ReportData");
var queues = reportData.GetProperty("Queues").EnumerateArray().ToArray();
diff --git a/src/ServiceControl.AcceptanceTests/Licensing/When_creating_a_usage_report_on_a_non_broker_transport.cs b/src/ServiceControl.AcceptanceTests/Licensing/When_creating_a_usage_report_on_a_non_broker_transport.cs
index a97e147535..574901f86f 100644
--- a/src/ServiceControl.AcceptanceTests/Licensing/When_creating_a_usage_report_on_a_non_broker_transport.cs
+++ b/src/ServiceControl.AcceptanceTests/Licensing/When_creating_a_usage_report_on_a_non_broker_transport.cs
@@ -6,6 +6,7 @@ namespace ServiceControl.AcceptanceTests.Licensing
using System.IO.Compression;
using System.Linq;
using System.Text.Json;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -21,7 +22,7 @@ namespace ServiceControl.AcceptanceTests.Licensing
class When_creating_a_usage_report_on_a_non_broker_transport : AcceptanceTest
{
[Test]
- public async Task Should_report_the_corrected_and_redacted_throughput()
+ public async Task Should_report_the_corrected_and_redacted_throughput(CancellationToken cancellationToken = default)
{
ReportGenerationState reportState = null;
ThroughputConnectionSettings connectionSettings = null;
@@ -80,7 +81,7 @@ await this.Post("/api/licensing/endpoints/update", new[]
report = ReadReport(archive);
})
.Done(_ => true)
- .Run();
+ .Run(cancellationToken);
var queues = report.RootElement.GetProperty("ReportData").GetProperty("Queues").EnumerateArray().ToArray();
diff --git a/src/ServiceControl.AcceptanceTests/Licensing/When_reporting_the_environment.cs b/src/ServiceControl.AcceptanceTests/Licensing/When_reporting_the_environment.cs
index 4d8d75b109..2c9098bc5e 100644
--- a/src/ServiceControl.AcceptanceTests/Licensing/When_reporting_the_environment.cs
+++ b/src/ServiceControl.AcceptanceTests/Licensing/When_reporting_the_environment.cs
@@ -5,6 +5,7 @@ namespace ServiceControl.AcceptanceTests.Licensing
using System.IO.Compression;
using System.Linq;
using System.Text.Json;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -20,7 +21,7 @@ namespace ServiceControl.AcceptanceTests.Licensing
class When_reporting_the_environment : AcceptanceTest
{
[Test]
- public async Task Should_describe_how_the_instance_is_deployed()
+ public async Task Should_describe_how_the_instance_is_deployed(CancellationToken cancellationToken = default)
{
JsonDocument report = null;
@@ -42,7 +43,7 @@ await Define()
return true;
})
.Done(_ => true)
- .Run();
+ .Run(cancellationToken);
var data = report.RootElement
.GetProperty("ReportData")
diff --git a/src/ServiceControl.AcceptanceTests/Licensing/When_the_license_is_requested.cs b/src/ServiceControl.AcceptanceTests/Licensing/When_the_license_is_requested.cs
index a56527625d..0e6eac3d12 100644
--- a/src/ServiceControl.AcceptanceTests/Licensing/When_the_license_is_requested.cs
+++ b/src/ServiceControl.AcceptanceTests/Licensing/When_the_license_is_requested.cs
@@ -1,6 +1,7 @@
namespace ServiceControl.AcceptanceTests.Licensing
{
using System.Net;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using NServiceBus.AcceptanceTesting;
@@ -10,7 +11,7 @@ namespace ServiceControl.AcceptanceTests.Licensing
class When_the_license_is_requested : AcceptanceTest
{
[Test]
- public async Task Should_report_the_instance_and_where_to_extend_the_trial()
+ public async Task Should_report_the_instance_and_where_to_extend_the_trial(CancellationToken cancellationToken = default)
{
LicenseInfo license = null;
@@ -21,7 +22,7 @@ await Define()
license = result.Item;
return result.HasResult;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
@@ -37,7 +38,7 @@ await Define()
}
[Test]
- public async Task Should_reject_a_request_that_names_no_client()
+ public async Task Should_reject_a_request_that_names_no_client(CancellationToken cancellationToken = default)
{
HttpStatusCode status = default;
@@ -48,7 +49,7 @@ await Define()
status = response.StatusCode;
return true;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(status, Is.EqualTo(HttpStatusCode.BadRequest));
}
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_a_custom_check_fails.cs b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_a_custom_check_fails.cs
index c14988cd2d..8647469843 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_a_custom_check_fails.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_a_custom_check_fails.cs
@@ -18,7 +18,7 @@
class When_a_custom_check_fails : AcceptanceTest
{
[Test]
- public async Task Should_result_in_a_custom_check_failed_event()
+ public async Task Should_result_in_a_custom_check_failed_event(CancellationToken cancellationToken = default)
{
EventLogItem entry = null;
@@ -30,7 +30,7 @@ await Define()
entry = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_a_failing_custom_check_is_dismissed.cs b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_a_failing_custom_check_is_dismissed.cs
index 29c462b580..4646d844a9 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_a_failing_custom_check_is_dismissed.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_a_failing_custom_check_is_dismissed.cs
@@ -18,7 +18,7 @@ namespace ServiceControl.AcceptanceTests.Monitoring.CustomChecks
class When_a_failing_custom_check_is_dismissed : AcceptanceTest
{
[Test]
- public async Task Should_come_back_while_the_check_is_still_failing()
+ public async Task Should_come_back_while_the_check_is_still_failing(CancellationToken cancellationToken = default)
{
CustomCheckView dismissed = null;
CustomCheckView returned = null;
@@ -52,7 +52,7 @@ await this.Delete($"/api/customchecks/{WithoutPrefix(dismissed.Id)}"))
return returned != null;
})
.Done(_ => true)
- .Run();
+ .Run(cancellationToken);
Assert.That(returned.FailureReason, Is.EqualTo(dismissed.FailureReason),
"Dismissing a check that is still failing cannot silence it for good, or a real failure disappears from the page for as long as it lasts");
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_a_periodic_custom_check_fails.cs b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_a_periodic_custom_check_fails.cs
index 57eb53b911..5573f60f04 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_a_periodic_custom_check_fails.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_a_periodic_custom_check_fails.cs
@@ -19,7 +19,7 @@
class When_a_periodic_custom_check_fails : AcceptanceTest
{
[Test]
- public async Task Should_result_in_a_custom_check_failed_event()
+ public async Task Should_result_in_a_custom_check_failed_event(CancellationToken cancellationToken = default)
{
EventLogItem entry = null;
@@ -31,7 +31,7 @@ await Define()
entry = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_custom_check_events_are_triggered.cs b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_custom_check_events_are_triggered.cs
index 4259e56e52..de3fa3aab8 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_custom_check_events_are_triggered.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_custom_check_events_are_triggered.cs
@@ -17,7 +17,7 @@
class When_custom_check_events_are_triggered : AcceptanceTest
{
[Test]
- public async Task Should_result_in_a_custom_check_failed_event()
+ public async Task Should_result_in_a_custom_check_failed_event(CancellationToken cancellationToken = default)
{
EventLogItem entry = null;
@@ -29,7 +29,7 @@ await Define()
entry = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_custom_checks_are_classified.cs b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_custom_checks_are_classified.cs
index 8b1995386e..2f255b80d5 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_custom_checks_are_classified.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_custom_checks_are_classified.cs
@@ -21,7 +21,7 @@ class When_custom_checks_are_classified : AcceptanceTest
const string InternalId = "ServiceControl Primary Instance";
[Test]
- public async Task Internal_checks_are_flagged_internal_and_endpoint_checks_are_not()
+ public async Task Internal_checks_are_flagged_internal_and_endpoint_checks_are_not(CancellationToken cancellationToken = default)
{
// The acceptance test runner disables internal custom checks by default; this test needs them.
SetSettings = settings => { settings.DisableHealthChecks = false; };
@@ -49,7 +49,7 @@ await Define()
return internalCheck != null && endpointCheck != null && wireBody != null;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
@@ -66,7 +66,7 @@ await Define()
}
[Test]
- public async Task Every_expected_internal_check_is_flagged_internal()
+ public async Task Every_expected_internal_check_is_flagged_internal(CancellationToken cancellationToken = default)
{
// The acceptance test runner disables internal custom checks by default; this test needs them.
SetSettings = settings => { settings.DisableHealthChecks = false; };
@@ -98,7 +98,7 @@ await Define()
return expectedIds.All(e => seen.Any(s => s.CustomCheckId == e));
})
- .Run();
+ .Run(cancellationToken);
foreach (var id in expectedIds)
{
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_email_notifications_are_configured.cs b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_email_notifications_are_configured.cs
index 542de55ade..23f6d6dec2 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_email_notifications_are_configured.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_email_notifications_are_configured.cs
@@ -23,7 +23,7 @@ namespace ServiceControl.AcceptanceTests.Monitoring.CustomChecks
class When_email_notifications_are_configured : AcceptanceTest
{
[Test]
- public async Task Should_gate_notifications_on_the_settings_the_page_saved()
+ public async Task Should_gate_notifications_on_the_settings_the_page_saved(CancellationToken cancellationToken = default)
{
var emailDropPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Directory.CreateDirectory(emailDropPath);
@@ -93,7 +93,7 @@ await Define()
return delivered != null;
})
.Done(_ => true)
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_email_notifications_are_enabled.cs b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_email_notifications_are_enabled.cs
index 5cbba441ff..637ce5ba68 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_email_notifications_are_enabled.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_email_notifications_are_enabled.cs
@@ -20,7 +20,7 @@
class When_email_notifications_are_enabled : AcceptanceTest
{
[Test]
- public async Task Should_send_custom_check_status_change_emails()
+ public async Task Should_send_custom_check_status_change_emails(CancellationToken cancellationToken = default)
{
var emailDropPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Directory.CreateDirectory(emailDropPath);
@@ -44,7 +44,7 @@ await Define(c =>
return emails.Length > 0 && TryReadHeaders(emails[0], out emailHeaders);
})
- .Run();
+ .Run(cancellationToken);
Assert.That(emailHeaders, Is.Not.Empty);
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_the_body_storage_check_is_reported.cs b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_the_body_storage_check_is_reported.cs
index a1fbfa6c4b..faa95bc9a0 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_the_body_storage_check_is_reported.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_the_body_storage_check_is_reported.cs
@@ -1,5 +1,6 @@
namespace ServiceControl.AcceptanceTests.Monitoring.CustomChecks
{
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using NServiceBus.AcceptanceTesting;
@@ -14,7 +15,7 @@ public void EnableInternalChecks() =>
SetSettings = static s => s.DisableHealthChecks = false;
[Test]
- public async Task Should_be_classified_internal()
+ public async Task Should_be_classified_internal(CancellationToken cancellationToken = default)
{
CustomCheckView bodyStorageCheck = null;
@@ -25,7 +26,7 @@ await Define()
bodyStorageCheck = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_a_custom_check_fails.cs b/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_a_custom_check_fails.cs
index c2d4161a55..557e599619 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_a_custom_check_fails.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_a_custom_check_fails.cs
@@ -2,6 +2,7 @@
{
using System;
using System.Collections.Generic;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -16,7 +17,7 @@
class When_a_custom_check_fails : AcceptanceTest
{
[Test]
- public async Task Should_publish_notification()
+ public async Task Should_publish_notification(CancellationToken cancellationToken = default)
{
var externalProcessorSubscribed = false;
CustomConfiguration = config => config.OnEndpointSubscribed((s, ctx) =>
@@ -55,7 +56,7 @@ await domainEvents.Raise(new Contracts.CustomChecks.CustomCheckFailed
}
}))
.Done(c => c.CustomCheckFailedReceived)
- .Run();
+ .Run(cancellationToken);
var enclosedType = context.IntegrationEventHeaders[Headers.EnclosedMessageTypes];
Assert.That(enclosedType, Is.EqualTo("ServiceControl.Contracts.CustomCheckFailed, ServiceControl.Contracts"));
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_a_custom_check_succeeds.cs b/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_a_custom_check_succeeds.cs
index 987acae9b2..b712d51292 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_a_custom_check_succeeds.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_a_custom_check_succeeds.cs
@@ -2,6 +2,7 @@
{
using System;
using System.Collections.Generic;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -16,7 +17,7 @@
class When_a_custom_check_succeeds : AcceptanceTest
{
[Test]
- public async Task Should_publish_notification()
+ public async Task Should_publish_notification(CancellationToken cancellationToken = default)
{
var externalProcessorSubscribed = false;
CustomConfiguration = config => config.OnEndpointSubscribed((s, ctx) =>
@@ -54,7 +55,7 @@ await domainEvents.Raise(new Contracts.CustomChecks.CustomCheckSucceeded
}
}))
.Done(c => c.CustomCheckSucceededReceived)
- .Run();
+ .Run(cancellationToken);
Assert.That(context.IntegrationEventHeaders[Headers.EnclosedMessageTypes],
Is.EqualTo("ServiceControl.Contracts.CustomCheckSucceeded, ServiceControl.Contracts"),
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_heartbeat_is_restored.cs b/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_heartbeat_is_restored.cs
index 71e7d4d303..4eb9f3fb96 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_heartbeat_is_restored.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_heartbeat_is_restored.cs
@@ -2,6 +2,7 @@ namespace ServiceControl.AcceptanceTests.Monitoring.ExternalIntegration
{
using System;
using System.Collections.Generic;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -20,7 +21,7 @@ namespace ServiceControl.AcceptanceTests.Monitoring.ExternalIntegration
class When_heartbeat_is_restored : AcceptanceTest
{
[Test]
- public async Task Should_publish_notification()
+ public async Task Should_publish_notification(CancellationToken cancellationToken = default)
{
var externalProcessorSubscribed = false;
@@ -54,7 +55,7 @@ public async Task Should_publish_notification()
}
}))
.Done(c => c.NotificationDelivered)
- .Run();
+ .Run(cancellationToken);
Assert.That(context.IntegrationEventHeaders[Headers.EnclosedMessageTypes],
Is.EqualTo("ServiceControl.Contracts.HeartbeatRestored, ServiceControl.Contracts"),
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_heartbeat_loss_is_detected.cs b/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_heartbeat_loss_is_detected.cs
index a737e05b0b..b0c64901b0 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_heartbeat_loss_is_detected.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/ExternalIntegration/When_heartbeat_loss_is_detected.cs
@@ -2,6 +2,7 @@ namespace ServiceControl.AcceptanceTests.Monitoring.ExternalIntegration
{
using System;
using System.Collections.Generic;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -21,7 +22,7 @@ namespace ServiceControl.AcceptanceTests.Monitoring.ExternalIntegration
class When_heartbeat_loss_is_detected : AcceptanceTest
{
[Test]
- public async Task Should_publish_notification()
+ public async Task Should_publish_notification(CancellationToken cancellationToken = default)
{
var externalProcessorSubscribed = false;
@@ -56,7 +57,7 @@ public async Task Should_publish_notification()
}
}))
.Done(c => c.NotificationDelivered)
- .Run();
+ .Run(cancellationToken);
Assert.That(context.IntegrationEventHeaders[Headers.EnclosedMessageTypes],
Is.EqualTo("ServiceControl.Contracts.HeartbeatStopped, ServiceControl.Contracts"),
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/InternalCustomChecks/When_a_critical_error_is_triggered.cs b/src/ServiceControl.AcceptanceTests/Monitoring/InternalCustomChecks/When_a_critical_error_is_triggered.cs
index c5539a3205..f22d17cdb5 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/InternalCustomChecks/When_a_critical_error_is_triggered.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/InternalCustomChecks/When_a_critical_error_is_triggered.cs
@@ -2,6 +2,7 @@
{
using System;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using Contracts.CustomChecks;
@@ -18,7 +19,7 @@
class When_a_critical_error_is_triggered : AcceptanceTest
{
[Test]
- public async Task Service_control_is_not_killed_and_error_is_reported_via_custom_check()
+ public async Task Service_control_is_not_killed_and_error_is_reported_via_custom_check(CancellationToken cancellationToken = default)
{
CustomizeHostBuilder = builder =>
{
@@ -50,7 +51,7 @@ await Define()
entry = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/InternalCustomChecks/When_a_custom_check_fails.cs b/src/ServiceControl.AcceptanceTests/Monitoring/InternalCustomChecks/When_a_custom_check_fails.cs
index a91dc56c84..33964c5a21 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/InternalCustomChecks/When_a_custom_check_fails.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/InternalCustomChecks/When_a_custom_check_fails.cs
@@ -28,7 +28,7 @@ public override Task PerformCheck(CancellationToken cancellationTok
}
[Test]
- public async Task Should_result_in_a_custom_check_failed_event()
+ public async Task Should_result_in_a_custom_check_failed_event(CancellationToken cancellationToken = default)
{
SetSettings = settings =>
{
@@ -49,7 +49,7 @@ await Define()
entry = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/When_a_failed_message_from_unmonitored_endpoint_is_imported.cs b/src/ServiceControl.AcceptanceTests/Monitoring/When_a_failed_message_from_unmonitored_endpoint_is_imported.cs
index 319fa0b351..9ba5cfcc76 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/When_a_failed_message_from_unmonitored_endpoint_is_imported.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/When_a_failed_message_from_unmonitored_endpoint_is_imported.cs
@@ -2,6 +2,7 @@
{
using System;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -17,7 +18,7 @@
class When_a_failed_message_from_unmonitored_endpoint_is_imported : AcceptanceTest
{
[Test]
- public async Task It_is_detected()
+ public async Task It_is_detected(CancellationToken cancellationToken = default)
{
EndpointsView[] endpoints = null;
@@ -29,14 +30,14 @@ public async Task It_is_detected()
endpoints = result;
return endpoints.Length > 0;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(endpoints.Length, Is.EqualTo(1));
Assert.That(endpoints.First().Name, Is.EqualTo(context.EndpointNameOfReceivingEndpoint));
}
[Test]
- public async Task It_is_persisted()
+ public async Task It_is_persisted(CancellationToken cancellationToken = default)
{
var endpointName = Conventions.EndpointNamingConvention(typeof(Receiver));
KnownEndpoint endpoint = default;
@@ -51,7 +52,7 @@ public async Task It_is_persisted()
endpoint = knownEndpoints.Item;
return knownEndpoints.HasResult;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(endpoint.Monitored, Is.False, "Endpoint detected through error ingestion should not be monitored");
}
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/When_an_endpoint_is_removed.cs b/src/ServiceControl.AcceptanceTests/Monitoring/When_an_endpoint_is_removed.cs
index f23d7d6760..b25d77fa59 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/When_an_endpoint_is_removed.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/When_an_endpoint_is_removed.cs
@@ -3,6 +3,7 @@ namespace ServiceControl.AcceptanceTests.Monitoring
using System;
using System.Collections.Generic;
using System.Net.Http;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -16,7 +17,7 @@ namespace ServiceControl.AcceptanceTests.Monitoring
class When_an_endpoint_is_removed : AcceptanceTest
{
[Test]
- public async Task Should_signal_support_for_delete()
+ public async Task Should_signal_support_for_delete(CancellationToken cancellationToken = default)
{
HttpResponseMessage response = null;
@@ -26,7 +27,7 @@ await Define()
response = await this.Options("/api/endpoints");
return true;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
@@ -36,7 +37,7 @@ await Define()
}
[Test]
- public async Task Should_be_successfully_deleted()
+ public async Task Should_be_successfully_deleted(CancellationToken cancellationToken = default)
{
var endpointsAfterDelete = new List();
@@ -55,7 +56,7 @@ await Define()
endpointsAfterDelete = await this.TryGetMany("/api/endpoints");
return true;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(endpointsAfterDelete, Is.Empty);
}
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/When_an_endpoint_starts_up.cs b/src/ServiceControl.AcceptanceTests/Monitoring/When_an_endpoint_starts_up.cs
index 41f3c5641d..66cb1362e6 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/When_an_endpoint_starts_up.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/When_an_endpoint_starts_up.cs
@@ -2,6 +2,7 @@
{
using System;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -17,7 +18,7 @@
class When_an_endpoint_starts_up : AcceptanceTest
{
[Test]
- public async Task Should_result_in_a_startup_event()
+ public async Task Should_result_in_a_startup_event(CancellationToken cancellationToken = default)
{
EventLogItem entry = null;
@@ -29,7 +30,7 @@ await Define()
entry = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/When_an_endpoint_with_heartbeat_plugin_starts_up.cs b/src/ServiceControl.AcceptanceTests/Monitoring/When_an_endpoint_with_heartbeat_plugin_starts_up.cs
index ed69a55865..3b593dd931 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/When_an_endpoint_with_heartbeat_plugin_starts_up.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/When_an_endpoint_with_heartbeat_plugin_starts_up.cs
@@ -1,5 +1,6 @@
namespace ServiceControl.AcceptanceTests.Monitoring
{
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -16,7 +17,7 @@ class When_an_endpoint_with_heartbeat_plugin_starts_up : AcceptanceTest
static string EndpointName => Conventions.EndpointNamingConvention(typeof(StartingEndpoint));
[Test]
- public async Task Should_be_monitored_and_active()
+ public async Task Should_be_monitored_and_active(CancellationToken cancellationToken = default)
{
EndpointsView endpoint = null;
@@ -28,7 +29,7 @@ await Define()
endpoint = result.Item;
return result.HasResult;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
@@ -38,7 +39,7 @@ await Define()
}
[Test]
- public async Task Should_be_persisted()
+ public async Task Should_be_persisted(CancellationToken cancellationToken = default)
{
var endpointName = Conventions.EndpointNamingConvention(typeof(StartingEndpoint));
KnownEndpoint endpoint = default;
@@ -52,7 +53,7 @@ await Define()
endpoint = result;
return result.HasResult;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(endpoint.Monitored, Is.True, "An endpoint discovered from heartbeats should be monitored");
}
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/When_an_unmonitored_endpoint_is_marked_as_monitored.cs b/src/ServiceControl.AcceptanceTests/Monitoring/When_an_unmonitored_endpoint_is_marked_as_monitored.cs
index acaa985d80..f3917f9e93 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/When_an_unmonitored_endpoint_is_marked_as_monitored.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/When_an_unmonitored_endpoint_is_marked_as_monitored.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -22,7 +23,7 @@ class When_an_unmonitored_endpoint_is_marked_as_monitored : AcceptanceTest
static string EndpointName => Conventions.EndpointNamingConvention(typeof(MyEndpoint));
[Test]
- public async Task It_is_shown_as_inactive_if_it_does_not_send_heartbeats()
+ public async Task It_is_shown_as_inactive_if_it_does_not_send_heartbeats(CancellationToken cancellationToken = default)
{
List endpoints = null;
var state = State.WaitingForEndpointDetection;
@@ -69,7 +70,7 @@ await Define()
endpoints = result;
return state == State.WaitingForHeartbeatFailure && result;
})
- .Run();
+ .Run(cancellationToken);
var myEndpoint = endpoints.FirstOrDefault(e => e.Name == EndpointName);
Assert.That(myEndpoint, Is.Not.Null);
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/When_endpoint_tracking_is_configured.cs b/src/ServiceControl.AcceptanceTests/Monitoring/When_endpoint_tracking_is_configured.cs
index 29db77686d..91334a9d0f 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/When_endpoint_tracking_is_configured.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/When_endpoint_tracking_is_configured.cs
@@ -2,6 +2,7 @@ namespace ServiceControl.AcceptanceTests.Monitoring
{
using System.Collections.Generic;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -15,7 +16,7 @@ namespace ServiceControl.AcceptanceTests.Monitoring
class When_endpoint_tracking_is_configured : AcceptanceTest
{
[Test]
- public async Task Should_read_and_change_tracking_for_one_endpoint_and_for_the_default()
+ public async Task Should_read_and_change_tracking_for_one_endpoint_and_for_the_default(CancellationToken cancellationToken = default)
{
List initial = null;
List afterEndpointChange = null;
@@ -56,7 +57,7 @@ await Define()
return afterDefaultChange != null;
})
.Done(_ => true)
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/When_heartbeat_stats_are_requested.cs b/src/ServiceControl.AcceptanceTests/Monitoring/When_heartbeat_stats_are_requested.cs
index 52dee69f51..cc584576b5 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/When_heartbeat_stats_are_requested.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/When_heartbeat_stats_are_requested.cs
@@ -1,6 +1,7 @@
namespace ServiceControl.AcceptanceTests.Monitoring
{
using System;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -12,7 +13,7 @@ namespace ServiceControl.AcceptanceTests.Monitoring
class When_heartbeat_stats_are_requested : AcceptanceTest
{
[Test]
- public async Task Should_count_a_heartbeating_endpoint_as_active()
+ public async Task Should_count_a_heartbeating_endpoint_as_active(CancellationToken cancellationToken = default)
{
HeartbeatStats stats = null;
@@ -24,14 +25,14 @@ await Define()
stats = result.Item;
return result.HasResult;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(stats.Failing, Is.Zero,
"An endpoint still sending heartbeats must not also be counted against the failing tile");
}
[Test]
- public async Task Should_count_an_endpoint_past_its_grace_period_as_failing()
+ public async Task Should_count_an_endpoint_past_its_grace_period_as_failing(CancellationToken cancellationToken = default)
{
HeartbeatStats stats = null;
@@ -47,7 +48,7 @@ await Define()
stats = result.Item;
return result.HasResult;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(stats.Active, Is.Zero,
"An endpoint counted as failing must have left the active tile, or the two tiles double count it");
diff --git a/src/ServiceControl.AcceptanceTests/Monitoring/When_unmonitored_endpoint_starts_to_sends_heartbeats.cs b/src/ServiceControl.AcceptanceTests/Monitoring/When_unmonitored_endpoint_starts_to_sends_heartbeats.cs
index 83d8bd77aa..3b7e3b936e 100644
--- a/src/ServiceControl.AcceptanceTests/Monitoring/When_unmonitored_endpoint_starts_to_sends_heartbeats.cs
+++ b/src/ServiceControl.AcceptanceTests/Monitoring/When_unmonitored_endpoint_starts_to_sends_heartbeats.cs
@@ -1,6 +1,7 @@
namespace ServiceControl.AcceptanceTests.Monitoring
{
using System;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -19,7 +20,7 @@ class When_unmonitored_endpoint_starts_to_sends_heartbeats : AcceptanceTest
static string EndpointName => Conventions.EndpointNamingConvention(typeof(WithoutHeartbeat));
[Test]
- public async Task Should_be_marked_as_monitored()
+ public async Task Should_be_marked_as_monitored(CancellationToken cancellationToken = default)
{
EndpointsView endpoint = null;
@@ -50,7 +51,7 @@ await Define()
return result.HasResult;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
@@ -68,7 +69,7 @@ await Define()
return result.HasResult;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_edit_is_resolved_by_retry.cs b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_edit_is_resolved_by_retry.cs
index bbe93e6e09..bcb629faf8 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_edit_is_resolved_by_retry.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_edit_is_resolved_by_retry.cs
@@ -2,6 +2,7 @@ namespace ServiceControl.AcceptanceTests.Recoverability.ExternalIntegration
{
using System.Collections.Generic;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -16,7 +17,7 @@ namespace ServiceControl.AcceptanceTests.Recoverability.ExternalIntegration
class When_a_failed_edit_is_resolved_by_retry : AcceptanceTest
{
[Test]
- public async Task Should_publish_notification()
+ public async Task Should_publish_notification(CancellationToken cancellationToken = default)
{
CustomConfiguration = config => config.OnEndpointSubscribed((s, ctx) =>
{
@@ -96,7 +97,7 @@ public async Task Should_publish_notification()
}
return true;
- }).Run();
+ }).Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_archived.cs b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_archived.cs
index 7fd796b0d5..07479a9c2f 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_archived.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_archived.cs
@@ -1,6 +1,7 @@
namespace ServiceControl.AcceptanceTests.Recoverability.ExternalIntegration
{
using System.Text.Json;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -14,7 +15,7 @@
class When_a_failed_message_is_archived : ExternalIntegrationAcceptanceTest
{
[Test]
- public async Task Should_publish_notification()
+ public async Task Should_publish_notification(CancellationToken cancellationToken = default)
{
CustomConfiguration = config => config.OnEndpointSubscribed((s, ctx) =>
{
@@ -48,7 +49,7 @@ public async Task Should_publish_notification()
e => e.Status == FailedMessageStatus.Archived);
})
.Done(ctx => ctx.EventDelivered) //Done when sequence is finished
- .Run();
+ .Run(cancellationToken);
var deserializedEvent = JsonSerializer.Deserialize(context.Event);
Assert.That(deserializedEvent.FailedMessagesIds, Has.Member(context.FailedMessageId.ToString()));
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_resolved_by_retry.cs b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_resolved_by_retry.cs
index cac3956868..5ef653e46a 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_resolved_by_retry.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_resolved_by_retry.cs
@@ -1,5 +1,6 @@
namespace ServiceControl.AcceptanceTests.Recoverability.ExternalIntegration
{
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -14,7 +15,7 @@
class When_a_failed_message_is_resolved_by_retry : ExternalIntegrationAcceptanceTest
{
[Test]
- public async Task Should_publish_notification()
+ public async Task Should_publish_notification(CancellationToken cancellationToken = default)
{
CustomConfiguration = config => config.OnEndpointSubscribed((s, ctx) =>
{
@@ -46,7 +47,7 @@ public async Task Should_publish_notification()
e => e.Status == FailedMessageStatus.Resolved);
})
.Done(ctx => ctx.EventDelivered) //Done when sequence is finished
- .Run();
+ .Run(cancellationToken);
var deserializedEvent = JsonSerializer.Deserialize(context.Event);
Assert.That(deserializedEvent?.FailedMessageId, Is.EqualTo(context.FailedMessageId.ToString()));
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_resolved_manually.cs b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_resolved_manually.cs
index 35edfbea62..22798b9891 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_resolved_manually.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_resolved_manually.cs
@@ -1,6 +1,7 @@
namespace ServiceControl.AcceptanceTests.Recoverability.ExternalIntegration
{
using System;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using NServiceBus;
@@ -16,7 +17,7 @@
class When_a_failed_message_is_resolved_manually : ExternalIntegrationAcceptanceTest
{
[Test]
- public async Task Should_publish_notification()
+ public async Task Should_publish_notification(CancellationToken cancellationToken = default)
{
CustomConfiguration = config => config.OnEndpointSubscribed((s, ctx) =>
{
@@ -57,7 +58,7 @@ public async Task Should_publish_notification()
e => e.Status == FailedMessageStatus.Resolved);
})
.Done(ctx => ctx.EventDelivered) //Done when sequence is finished
- .Run();
+ .Run(cancellationToken);
var deserializedEvent = JsonSerializer.Deserialize(context.Event);
Assert.That(deserializedEvent.FailedMessageId, Is.EqualTo(context.FailedMessageId.ToString()));
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_unarchived.cs b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_unarchived.cs
index ea3998e399..b1bf59ef5c 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_unarchived.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_message_is_unarchived.cs
@@ -1,6 +1,7 @@
namespace ServiceControl.AcceptanceTests.Recoverability.ExternalIntegration
{
using System;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using NServiceBus;
@@ -16,7 +17,7 @@
class When_a_failed_message_is_unarchived : ExternalIntegrationAcceptanceTest
{
[Test]
- public async Task Should_publish_notification()
+ public async Task Should_publish_notification(CancellationToken cancellationToken = default)
{
CustomConfiguration = config => config.OnEndpointSubscribed((s, ctx) =>
{
@@ -63,7 +64,7 @@ public async Task Should_publish_notification()
e => e.Status == FailedMessageStatus.Unresolved);
})
.Done(ctx => ctx.EventDelivered) //Done when sequence is finished
- .Run();
+ .Run(cancellationToken);
var deserializedEvent = JsonSerializer.Deserialize(context.Event);
Assert.That(deserializedEvent.FailedMessagesIds, Is.Not.Null);
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_msg_is_resolved_by_edit.cs b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_msg_is_resolved_by_edit.cs
index 68d49c0b68..8a31244075 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_msg_is_resolved_by_edit.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_failed_msg_is_resolved_by_edit.cs
@@ -1,6 +1,7 @@
namespace ServiceControl.AcceptanceTests.Recoverability.ExternalIntegration
{
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -15,7 +16,7 @@ namespace ServiceControl.AcceptanceTests.Recoverability.ExternalIntegration
class When_a_failed_msg_is_resolved_by_edit : AcceptanceTest
{
[Test]
- public async Task Should_publish_notification()
+ public async Task Should_publish_notification(CancellationToken cancellationToken = default)
{
CustomConfiguration = config => config.OnEndpointSubscribed((s, ctx) =>
{
@@ -84,7 +85,7 @@ public async Task Should_publish_notification()
}
return true;
- }).Run();
+ }).Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_group_is_archived.cs b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_group_is_archived.cs
index 36b3ed3e32..afaa8698b4 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_group_is_archived.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_group_is_archived.cs
@@ -2,6 +2,7 @@
{
using System;
using System.Text.Json;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -16,7 +17,7 @@
class When_a_group_is_archived : ExternalIntegrationAcceptanceTest
{
[Test]
- public async Task Should_publish_notification()
+ public async Task Should_publish_notification(CancellationToken cancellationToken = default)
{
CustomConfiguration = config => config.OnEndpointSubscribed((s, ctx) =>
{
@@ -63,7 +64,7 @@ public async Task Should_publish_notification()
e => e.Status == FailedMessageStatus.Archived);
})
.Done(ctx => ctx.EventDelivered) //Done when sequence is finished
- .Run();
+ .Run(cancellationToken);
var deserializedEvent = JsonSerializer.Deserialize(context.Event);
Assert.That(deserializedEvent.FailedMessagesIds, Is.Not.Null);
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_message_has_failed_detected.cs b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_message_has_failed_detected.cs
index b07036890c..fc5c8b1754 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_message_has_failed_detected.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_message_has_failed_detected.cs
@@ -2,6 +2,7 @@
{
using System;
using System.Text.Json;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -14,7 +15,7 @@
class When_a_message_has_failed_detected : AcceptanceTest
{
[Test]
- public async Task Should_publish_notification()
+ public async Task Should_publish_notification(CancellationToken cancellationToken = default)
{
CustomConfiguration = config => config.OnEndpointSubscribed((s, ctx) =>
{
@@ -42,7 +43,7 @@ public async Task Should_publish_notification()
}
}))
.Done(c => c.EventDelivered)
- .Run();
+ .Run(cancellationToken);
var deserializedEvent = JsonSerializer.Deserialize(context.Event);
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_reedit_solves_a_failed_msg.cs b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_reedit_solves_a_failed_msg.cs
index d2cad9f0e2..8a22e626a0 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_reedit_solves_a_failed_msg.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_a_reedit_solves_a_failed_msg.cs
@@ -2,6 +2,7 @@ namespace ServiceControl.AcceptanceTests.Recoverability.ExternalIntegration
{
using System.Collections.Generic;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -16,7 +17,7 @@ namespace ServiceControl.AcceptanceTests.Recoverability.ExternalIntegration
class When_a_reedit_solves_a_failed_msg : AcceptanceTest
{
[Test]
- public async Task Should_publish_notification()
+ public async Task Should_publish_notification(CancellationToken cancellationToken = default)
{
CustomConfiguration = config => config.OnEndpointSubscribed((s, ctx) =>
{
@@ -116,7 +117,7 @@ public async Task Should_publish_notification()
}
return true;
- }).Run();
+ }).Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_encountered_an_error.cs b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_encountered_an_error.cs
index f011edcf84..e67bcb138e 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_encountered_an_error.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/ExternalIntegration/When_encountered_an_error.cs
@@ -25,7 +25,7 @@ namespace ServiceControl.AcceptanceTests.Recoverability.ExternalIntegration
class When_encountered_an_error : AcceptanceTest
{
[Test]
- public async Task Should_restart_dispatch_thread()
+ public async Task Should_restart_dispatch_thread(CancellationToken cancellationToken = default)
{
var externalProcessorSubscribed = false;
@@ -65,7 +65,7 @@ public async Task Should_restart_dispatch_thread()
}
}))
.Done(c => c.NotificationDelivered)
- .Run();
+ .Run(cancellationToken);
Assert.That(context.Failed, Is.True, "The faulty publisher never ran, so the notification was not delivered in spite of one");
}
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_ServiceControl_has_started.cs b/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_ServiceControl_has_started.cs
index 89681785ee..a0584c1d82 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_ServiceControl_has_started.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_ServiceControl_has_started.cs
@@ -1,6 +1,7 @@
namespace ServiceControl.AcceptanceTests.Recoverability.Groups
{
using System.Collections.Generic;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using NServiceBus.AcceptanceTesting;
@@ -10,7 +11,7 @@
class When_ServiceControl_has_started : AcceptanceTest
{
[Test]
- public async Task All_classifiers_should_be_retrievable()
+ public async Task All_classifiers_should_be_retrievable(CancellationToken cancellationToken = default)
{
List classifiers = null;
@@ -21,7 +22,7 @@ await Define()
classifiers = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(classifiers, Is.Not.Null, "classifiers is null");
Assert.That(classifiers, Is.Not.Empty, "No classifiers retrieved");
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_a_failing_endpoint_is_triaged_and_retried.cs b/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_a_failing_endpoint_is_triaged_and_retried.cs
index befe3ac671..67eb5f3328 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_a_failing_endpoint_is_triaged_and_retried.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_a_failing_endpoint_is_triaged_and_retried.cs
@@ -3,6 +3,7 @@ namespace ServiceControl.AcceptanceTests.Recoverability.Groups
using System;
using System.Collections.Generic;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -18,7 +19,7 @@ namespace ServiceControl.AcceptanceTests.Recoverability.Groups
class When_a_failing_endpoint_is_triaged_and_retried : AcceptanceTest
{
[Test]
- public async Task Should_narrow_to_the_group_annotate_it_and_clear_it_once_retried()
+ public async Task Should_narrow_to_the_group_annotate_it_and_clear_it_once_retried(CancellationToken cancellationToken = default)
{
Dictionary> summary = null;
List broken = null;
@@ -126,7 +127,7 @@ await Define()
return history.HasResult;
})
.Done(_ => true)
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_a_group_is_archived.cs b/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_a_group_is_archived.cs
index a53dab25bc..2603a12e2d 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_a_group_is_archived.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_a_group_is_archived.cs
@@ -17,7 +17,7 @@
class When_a_group_is_archived : AcceptanceTest
{
[Test]
- public async Task All_messages_in_group_should_get_archived()
+ public async Task All_messages_in_group_should_get_archived(CancellationToken cancellationToken = default)
{
await Define()
.WithEndpoint(b => b.When(async bus =>
@@ -59,11 +59,11 @@ await Define()
e => e.Status == FailedMessageStatus.Archived);
})
.Done(ctx => true) //Done when sequence is finished
- .Run();
+ .Run(cancellationToken);
}
[Test]
- public async Task All_archived_messages_should_be_grouped()
+ public async Task All_archived_messages_should_be_grouped(CancellationToken cancellationToken = default)
{
await Define()
.WithEndpoint(b => b.When(async bus =>
@@ -110,11 +110,11 @@ await Define()
return failedMessages && failedMessages.Items.Count == 1 && failedMessages.Items[0].Count == 2;
})
.Done(ctx => true) //Done when sequence is finished
- .Run();
+ .Run(cancellationToken);
}
[Test]
- public async Task Archived_messages_group_info_should_be_accessible()
+ public async Task Archived_messages_group_info_should_be_accessible(CancellationToken cancellationToken = default)
{
await Define()
.WithEndpoint(b => b.When(async bus =>
@@ -161,7 +161,7 @@ await Define()
return failedMessages && failedMessages.Item.Count == 2;
})
.Done(ctx => true) //Done when sequence is finished
- .Run();
+ .Run(cancellationToken);
}
[Test]
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_message_groups_are_sorted_by_a_web_api_call.cs b/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_message_groups_are_sorted_by_a_web_api_call.cs
index 15ac12a070..10d079f6be 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_message_groups_are_sorted_by_a_web_api_call.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_message_groups_are_sorted_by_a_web_api_call.cs
@@ -2,6 +2,7 @@ namespace ServiceControl.AcceptanceTests.Recoverability.Groups
{
using System;
using System.Collections.Generic;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -17,9 +18,9 @@ namespace ServiceControl.AcceptanceTests.Recoverability.Groups
class When_message_groups_are_sorted_by_a_web_api_call : AcceptanceTest
{
[Test]
- public async Task All_messages_in_group_should_be_sorted_by_time_sent()
+ public async Task All_messages_in_group_should_be_sorted_by_time_sent(CancellationToken cancellationToken = default)
{
- var errors = await SortTest("time_sent");
+ var errors = await SortTest("time_sent", cancellationToken);
using (Assert.EnterMultipleScope())
{
@@ -30,9 +31,9 @@ public async Task All_messages_in_group_should_be_sorted_by_time_sent()
}
[Test]
- public async Task All_messages_in_group_should_be_sorted_by_message_type()
+ public async Task All_messages_in_group_should_be_sorted_by_message_type(CancellationToken cancellationToken = default)
{
- var errors = await SortTest("message_type");
+ var errors = await SortTest("message_type", cancellationToken);
using (Assert.EnterMultipleScope())
{
@@ -42,7 +43,7 @@ public async Task All_messages_in_group_should_be_sorted_by_message_type()
}
}
- async Task> SortTest(string sortProperty)
+ async Task> SortTest(string sortProperty, CancellationToken cancellationToken)
{
List localErrors = null;
@@ -76,7 +77,7 @@ await Define()
return true;
})
- .Run();
+ .Run(cancellationToken);
return localErrors;
}
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_messages_have_failed.cs b/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_messages_have_failed.cs
index 081b444b54..a12f682fbb 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_messages_have_failed.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_messages_have_failed.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -17,7 +18,7 @@
class When_messages_have_failed : AcceptanceTest
{
[Test]
- public async Task Should_be_grouped()
+ public async Task Should_be_grouped(CancellationToken cancellationToken = default)
{
List defaultGroups = null;
List exceptionTypeAndStackTraceGroups = null;
@@ -65,7 +66,7 @@ public async Task Should_be_grouped()
return true;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_two_similar_messages_have_failed.cs b/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_two_similar_messages_have_failed.cs
index d3be57acac..019468f3fe 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_two_similar_messages_have_failed.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/Groups/When_two_similar_messages_have_failed.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -17,7 +18,7 @@
class When_two_similar_messages_have_failed : AcceptanceTest
{
[Test]
- public async Task They_should_be_grouped_together()
+ public async Task They_should_be_grouped_together(CancellationToken cancellationToken = default)
{
List exceptionTypeAndStackTraceGroups = null;
List messageTypeGroups = null;
@@ -64,7 +65,7 @@ await Define()
return secondFailureResult;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/Is_System_Message_Tests.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/Is_System_Message_Tests.cs
index a1226f66c2..93935e06ef 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/Is_System_Message_Tests.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/Is_System_Message_Tests.cs
@@ -2,6 +2,7 @@
{
using System;
using System.Collections.Generic;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -15,7 +16,7 @@
class Is_System_Message_Tests : AcceptanceTest
{
[Test]
- public async Task Should_set_the_IsSystemMessage_when_message_type_is_not_a_scheduled_task()
+ public async Task Should_set_the_IsSystemMessage_when_message_type_is_not_a_scheduled_task(CancellationToken cancellationToken = default)
{
FailedMessageView failure = null;
await Define(ctx =>
@@ -31,14 +32,14 @@ await Define(ctx =>
failure = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(failure, Is.Not.Null);
Assert.That(failure.IsSystemMessage, Is.False);
}
[Test]
- public async Task Should_set_the_IsSystemMessage_when_message_type_is_a_scheduled_task()
+ public async Task Should_set_the_IsSystemMessage_when_message_type_is_a_scheduled_task(CancellationToken cancellationToken = default)
{
FailedMessageView failure = null;
await Define(ctx =>
@@ -54,13 +55,13 @@ await Define(ctx =>
failure = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(failure, Is.Not.Null);
Assert.That(failure.IsSystemMessage, Is.True);
}
[Test]
- public async Task Should_set_the_IsSystemMessage_when_control_message_header_is_true()
+ public async Task Should_set_the_IsSystemMessage_when_control_message_header_is_true(CancellationToken cancellationToken = default)
{
FailedMessageView failure = null;
await Define(ctx =>
@@ -77,13 +78,13 @@ await Define(ctx =>
failure = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(failure, Is.Not.Null);
Assert.That(failure.IsSystemMessage, Is.True);
}
[Test]
- public async Task Should_set_the_IsSystemMessage_when_control_message_header_is_null()
+ public async Task Should_set_the_IsSystemMessage_when_control_message_header_is_null(CancellationToken cancellationToken = default)
{
FailedMessageView failure = null;
await Define(ctx =>
@@ -100,14 +101,14 @@ await Define(ctx =>
failure = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(failure, Is.Not.Null);
Assert.That(failure.IsSystemMessage, Is.True);
}
[Test]
- public async Task Should_set_the_IsSystemMessage_for_integration_scenario()
+ public async Task Should_set_the_IsSystemMessage_for_integration_scenario(CancellationToken cancellationToken = default)
{
FailedMessageView failure = null;
await Define(ctx =>
@@ -123,7 +124,7 @@ await Define(ctx =>
failure = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(failure, Is.Not.Null);
Assert.That(failure.IsSystemMessage, Is.False);
}
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_SagaComplete_message_fails.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_SagaComplete_message_fails.cs
index 9a4fb727ff..ed1422f15f 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_SagaComplete_message_fails.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_SagaComplete_message_fails.cs
@@ -2,6 +2,7 @@
{
using System;
using System.Collections.Generic;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -17,7 +18,7 @@
class When_a_SagaComplete_message_fails : AcceptanceTest
{
[Test]
- public async Task No_SagaType_Header_Is_Ok()
+ public async Task No_SagaType_Header_Is_Ok(CancellationToken cancellationToken = default)
{
FailedMessageView failure = null;
@@ -29,7 +30,7 @@ await Define()
failure = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(failure, Is.Not.Null);
}
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_failed_message_is_pending_retry.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_failed_message_is_pending_retry.cs
index 2bbb0b2f86..43774d8d6a 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_failed_message_is_pending_retry.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_failed_message_is_pending_retry.cs
@@ -18,7 +18,7 @@
class When_a_failed_message_is_pending_retry : AcceptanceTest
{
[Test]
- public async Task Should_status_retryissued_after_retry_is_sent()
+ public async Task Should_status_retryissued_after_retry_is_sent(CancellationToken cancellationToken = default)
{
FailedMessage failedMessage = null;
@@ -37,7 +37,7 @@ await Define()
failedMessage = await this.TryGet($"/api/errors/{ctx.UniqueMessageId}");
})
.Done()
- .Run();
+ .Run(cancellationToken);
Assert.That(failedMessage.Status, Is.EqualTo(FailedMessageStatus.RetryIssued), "Status was not set to RetryIssued");
}
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_message_has_failed.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_message_has_failed.cs
index fc8bae05e9..d58564c750 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_message_has_failed.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_message_has_failed.cs
@@ -30,7 +30,7 @@ namespace ServiceControl.AcceptanceTests.Recoverability.MessageFailures
class When_a_message_has_failed : AcceptanceTest
{
[Test]
- public async Task Should_be_imported_and_accessible_via_the_rest_api()
+ public async Task Should_be_imported_and_accessible_via_the_rest_api(CancellationToken cancellationToken = default)
{
FailedMessage failedMessage = null;
@@ -42,7 +42,7 @@ public async Task Should_be_imported_and_accessible_via_the_rest_api()
failedMessage = result;
return c.MessageId != null && result;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
@@ -61,7 +61,7 @@ public async Task Should_be_imported_and_accessible_via_the_rest_api()
[Theory]
[TestCase(false)]
[TestCase(true)] // creates body above 85000 bytes to make sure it is ingested into the body storage
- public async Task Should_be_imported_and_body_via_the_rest_api(bool largeMessage)
+ public async Task Should_be_imported_and_body_via_the_rest_api(bool largeMessage, CancellationToken cancellationToken = default)
{
HttpResponseMessage result = null;
@@ -83,16 +83,16 @@ await Define()
result = await this.GetRaw("/api/messages/" + c.MessageId + "/body");
return result.IsSuccessStatusCode;
})
- .Run();
+ .Run(cancellationToken);
- var stringResult = await result.Content.ReadAsStringAsync();
+ var stringResult = await result.Content.ReadAsStringAsync(cancellationToken);
var expectedResult = $"{{\"Content\":\"{myMessage.Content}\"}}";
Assert.That(stringResult, Is.EqualTo(expectedResult));
}
[Test]
- public async Task Should_be_imported_with_custom_serialization_and_body_via_the_rest_api()
+ public async Task Should_be_imported_with_custom_serialization_and_body_via_the_rest_api(CancellationToken cancellationToken = default)
{
HttpResponseMessage result = null;
@@ -114,14 +114,14 @@ await Define()
result = await this.GetRaw("/api/messages/" + c.MessageId + "/body");
return result.IsSuccessStatusCode;
})
- .Run();
+ .Run(cancellationToken);
- var content = await result.Content.ReadAsStringAsync();
+ var content = await result.Content.ReadAsStringAsync(cancellationToken);
Assert.That(content, Does.Contain($"{myMessage.Content}"));
}
[Test]
- public async Task Should_be_listed_in_the_error_list()
+ public async Task Should_be_listed_in_the_error_list(CancellationToken cancellationToken = default)
{
FailedMessageView failure = null;
@@ -133,7 +133,7 @@ public async Task Should_be_listed_in_the_error_list()
failure = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
@@ -170,7 +170,7 @@ public async Task Should_be_listed_in_the_messages_list(CancellationToken cancel
}
[Test]
- public async Task Should_add_an_event_log_item()
+ public async Task Should_add_an_event_log_item(CancellationToken cancellationToken = default)
{
EventLogItem entry = null;
@@ -182,7 +182,7 @@ public async Task Should_add_an_event_log_item()
entry = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
using (Assert.EnterMultipleScope())
{
@@ -194,7 +194,7 @@ public async Task Should_add_an_event_log_item()
}
[Test]
- public async Task Should_be_able_to_search_queueaddresses()
+ public async Task Should_be_able_to_search_queueaddresses(CancellationToken cancellationToken = default)
{
var searchResults = new List();
@@ -216,7 +216,7 @@ await Define()
}, (session, ctx) => Task.CompletedTask);
})
.Done(c => searchResults.Count == 1)
- .Run();
+ .Run(cancellationToken);
Assert.That(searchResults.Count, Is.EqualTo(1), "Result count did not match");
}
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_message_has_failed_from_send_only_endpoint.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_message_has_failed_from_send_only_endpoint.cs
index a310abb4b7..e7632ce1d9 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_message_has_failed_from_send_only_endpoint.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_message_has_failed_from_send_only_endpoint.cs
@@ -2,6 +2,7 @@
{
using System;
using System.Collections.Generic;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -15,7 +16,7 @@
class When_a_message_has_failed_from_send_only_endpoint : AcceptanceTest
{
[Test]
- public async Task Should_be_listed_in_the_error_list_when_processing_endpoint_header_is_not_present()
+ public async Task Should_be_listed_in_the_error_list_when_processing_endpoint_header_is_not_present(CancellationToken cancellationToken = default)
{
FailedMessageView failure = null;
await Define(ctx =>
@@ -30,13 +31,13 @@ await Define(ctx =>
failure = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(failure, Is.Not.Null);
Assert.That(failure.ReceivingEndpoint.Name, Does.Contain("SomeEndpoint"), $"The sending endpoint should be SomeEndpoint and not {failure.ReceivingEndpoint.Name}");
}
[Test]
- public async Task Should_be_listed_in_the_error_list_when_processing_endpoint_header_is_present()
+ public async Task Should_be_listed_in_the_error_list_when_processing_endpoint_header_is_present(CancellationToken cancellationToken = default)
{
FailedMessageView failure = null;
await Define(ctx =>
@@ -51,7 +52,7 @@ await Define(ctx =>
failure = result;
return result;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(failure, Is.Not.Null);
Assert.That(failure.ReceivingEndpoint.Name, Does.Contain("SomeEndpoint"), $"The sending endpoint should be SomeEndpoint and not {failure.ReceivingEndpoint.Name}");
}
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_messages_fails_multiple_times.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_messages_fails_multiple_times.cs
index 1bb57db166..5ea2e1fa96 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_messages_fails_multiple_times.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_messages_fails_multiple_times.cs
@@ -9,6 +9,7 @@ namespace ServiceControl.AcceptanceTests.Recoverability
using System.Collections.Generic;
using System;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting.EndpointTemplates;
using ServiceControl.Infrastructure;
@@ -20,7 +21,7 @@ class When_a_messages_fails_multiple_times : AcceptanceTest
const string AttemptNumberHeaderKey = "testing.failed_attempt_no";
[Test]
- public async Task Should_report_the_most_recent_attempt_last()
+ public async Task Should_report_the_most_recent_attempt_last(CancellationToken cancellationToken = default)
{
FailedMessage result = null;
@@ -39,7 +40,7 @@ await Define()
return result != null;
})
- .Run();
+ .Run(cancellationToken);
Assert.That(LatestAttemptNumber(result), Is.EqualTo(NumberOfFailedAttempts.ToString()));
}
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_resolved_by_selection.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_resolved_by_selection.cs
index fdf39ca8bf..d5d46b599e 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_resolved_by_selection.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_resolved_by_selection.cs
@@ -2,6 +2,7 @@
{
using System;
using System.Collections.Generic;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -16,7 +17,7 @@
class When_a_pending_retry_is_resolved_by_selection : AcceptanceTest
{
[Test]
- public async Task Should_succeed() =>
+ public async Task Should_succeed(CancellationToken cancellationToken = default) =>
await Define()
.WithEndpoint(b => b.When(bus => bus.SendLocal(new MyMessage())).DoNotFailOnErrorMessages())
.Do("DetectFailure", async ctx =>
@@ -46,7 +47,7 @@ await Define()
message => message.Status == FailedMessageStatus.Resolved);
})
.Done(ctx => true) //We're done once the sequence is finished
- .Run();
+ .Run(cancellationToken);
public class FailingEndpoint : EndpointConfigurationBuilder
{
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_resolved_by_timeframe.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_resolved_by_timeframe.cs
index 4d2c5462af..a096354a0f 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_resolved_by_timeframe.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_resolved_by_timeframe.cs
@@ -2,6 +2,7 @@
{
using System;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -17,7 +18,7 @@
class When_a_pending_retry_is_resolved_by_timeframe : AcceptanceTest
{
[Test]
- public async Task Should_succeed() =>
+ public async Task Should_succeed(CancellationToken cancellationToken = default) =>
await Define()
.WithEndpoint(b => b.When(bus => bus.SendLocal(new MyMessage())).DoNotFailOnErrorMessages())
.Do("DetectFailure", async ctx =>
@@ -54,7 +55,7 @@ await Define()
message => message.Status == FailedMessageStatus.Resolved);
})
.Done(ctx => true) //We're done once the sequence is finished
- .Run();
+ .Run(cancellationToken);
public class Failing : EndpointConfigurationBuilder
{
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_retried_again.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_retried_again.cs
index 3a16100884..ef0e1efcd3 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_retried_again.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_retried_again.cs
@@ -2,6 +2,7 @@
{
using System;
using System.Collections.Generic;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -16,7 +17,7 @@
class When_a_pending_retry_is_retried_again : AcceptanceTest
{
[Test]
- public async Task Should_succeed() =>
+ public async Task Should_succeed(CancellationToken cancellationToken = default) =>
await Define()
.WithEndpoint(b => b.When(bus => bus.SendLocal(new MyMessage())).DoNotFailOnErrorMessages())
.Do("DetectFailure", async ctx =>
@@ -42,7 +43,7 @@ await Define()
});
})
.Done(ctx => ctx.RetryCount == 2)
- .Run();
+ .Run(cancellationToken);
public class FailingEndpoint : EndpointConfigurationBuilder
{
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_retried_by_queue_and_timeframe.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_retried_by_queue_and_timeframe.cs
index 8830b56754..4786925acf 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_retried_by_queue_and_timeframe.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_pending_retry_is_retried_by_queue_and_timeframe.cs
@@ -2,6 +2,7 @@
{
using System;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -17,7 +18,7 @@
class When_a_pending_retry_is_retried_by_queue_and_timeframe : AcceptanceTest
{
[Test]
- public async Task Should_succeed() =>
+ public async Task Should_succeed(CancellationToken cancellationToken = default) =>
await Define()
.WithEndpoint(b => b.When(bus => bus.SendLocal(new MyMessage())).DoNotFailOnErrorMessages())
.Do("DetectFailure", async ctx =>
@@ -46,7 +47,7 @@ await Define()
});
})
.Done(ctx => ctx.RetryCount == 2)
- .Run();
+ .Run(cancellationToken);
public class Failing : EndpointConfigurationBuilder
{
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_an_event_with_multiple_subscribers_fails.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_an_event_with_multiple_subscribers_fails.cs
index 7c5b724be7..a739d41f9c 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_an_event_with_multiple_subscribers_fails.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_an_event_with_multiple_subscribers_fails.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -16,7 +17,7 @@
class When_an_event_with_multiple_subscribers_fails : AcceptanceTest
{
[Test]
- public async Task There_should_be_a_FailedMessage_for_each_subscriber()
+ public async Task There_should_be_a_FailedMessage_for_each_subscriber(CancellationToken cancellationToken = default)
{
var failedMessages = new List();
@@ -28,7 +29,7 @@ await Define()
failedMessages = result;
return result && failedMessages.Sum(x => x.NumberOfProcessingAttempts) >= 2;
})
- .Run();
+ .Run(cancellationToken);
var subscriber1FailedMessage = failedMessages.SingleOrDefault(msg => msg.QueueAddress.Contains("subscriber1"));
var subscriber2FailedMessage = failedMessages.SingleOrDefault(msg => msg.QueueAddress.Contains("subscriber2"));
diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_deleted_messages_are_restored.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_deleted_messages_are_restored.cs
index 7613cbd6b6..e80c0e20a5 100644
--- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_deleted_messages_are_restored.cs
+++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_deleted_messages_are_restored.cs
@@ -3,6 +3,7 @@ namespace ServiceControl.AcceptanceTests.Recoverability.MessageFailures
using System;
using System.Collections.Generic;
using System.Linq;
+ using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
@@ -17,7 +18,7 @@ namespace ServiceControl.AcceptanceTests.Recoverability.MessageFailures
class When_deleted_messages_are_restored : AcceptanceTest
{
[Test]
- public async Task Should_restore_a_deleted_selection_and_a_deleted_group()
+ public async Task Should_restore_a_deleted_selection_and_a_deleted_group(CancellationToken cancellationToken = default)
{
string[] afterSelectionDeleted = null;
string[] afterRangeRestored = null;
@@ -115,7 +116,7 @@ await this.Post