Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ea78361
fix flaky HeartbeatEndpointSettingsSyncHostedService tests by polling…
soujay Aug 12, 2026
b6a19aa
remove comment
soujay Aug 12, 2026
a3ab21d
Update SSH.NET to 2026.0.0 to address CVE
johnsimons Aug 13, 2026
d9c9b47
Merge pull request #5758 from Particular/john/update_for_cve
johnsimons Aug 13, 2026
f976a31
Move Event Source setup to shared acceptance test projects
johnsimons Aug 12, 2026
81e37db
Merge pull request #5755 from Particular/john/event_source_fix
johnsimons Aug 13, 2026
236b8ee
Propagate cancellation tokens through monitoring hosting and backgrou…
johnsimons Aug 12, 2026
27033c9
Merge pull request #5751 from Particular/john/cancel_phase6
johnsimons Aug 13, 2026
5945faf
Propagate cancellation tokens through the installer engine and the Co…
johnsimons Aug 12, 2026
1840e2c
Refactor body storage retrieval to use explicit result states
johnsimons Aug 12, 2026
25d977d
Merge pull request #5759 from Particular/john/bodystorage_acceptancet…
johnsimons Aug 13, 2026
ec0b69c
Propagate cancellation tokens through persistence dialects, licensing…
johnsimons Aug 12, 2026
e42c235
Merge pull request #5753 from Particular/john/cancel_p7_installer_config
johnsimons Aug 13, 2026
f274291
Merge pull request #5754 from Particular/john/cancel_p7_persistence_l…
johnsimons Aug 13, 2026
2cd5db7
Drop redundant cancellation token arguments from the test projects
johnsimons Aug 12, 2026
64c70a5
Await the deployed instances refresh instead of firing it as async void
johnsimons Aug 12, 2026
e993fe3
Merge pull request #5769 from Particular/john/cancel_p7_test_projects
johnsimons Aug 13, 2026
0e55aec
Merge pull request #5768 from Particular/john/listinstances_async_void
johnsimons Aug 13, 2026
1287f37
fix flaky HeartbeatEndpointSettingsSyncHostedService tests by polling…
soujay Aug 12, 2026
fa50be2
remove comment
soujay Aug 12, 2026
569e5f8
Merge branch 'flaky-test-5747' of https://github.com/Particular/Servi…
soujay Aug 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
<PackageVersion Include="System.Threading.RateLimiting" Version="$(RuntimeFrameworkVersion)" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="7.0.2" />
<PackageVersion Include="Azure.Core" Version="1.60.0" />
<PackageVersion Include="SSH.NET" Version="2026.0.0" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="Microsoft.Build.Artifacts" Version="6.1.63" />
Expand Down
3 changes: 0 additions & 3 deletions src/Particular.LicensingComponent.UnitTests/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ dotnet_diagnostic.CA2007.severity = none
# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0.
# They are scheduled work, not accepted exceptions: remove a line once this project has no
# violations of that rule left, and never add a rule back to this list.
dotnet_diagnostic.PS0003.severity = none
dotnet_diagnostic.PS0006.severity = none
dotnet_diagnostic.PS0017.severity = none
dotnet_diagnostic.PS0018.severity = none
24 changes: 12 additions & 12 deletions src/Particular.LicensingComponent.UnitTests/AuditQuery_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public async Task Should_return_known_endpoints_if_any()
var auditQuery = new AuditQuery(NullLogger<AuditQuery>.Instance, new EndpointsApi_ReturningTwoEndpoints(), new FakeAuditCountApi(), new FakeConfigurationApi());

//Act
var endpoints = (await auditQuery.GetKnownEndpoints(default)).ToList();
var endpoints = (await auditQuery.GetKnownEndpoints()).ToList();

//Assert
Assert.That(endpoints, Is.Not.Null, "Endpoints should be found");
Expand All @@ -53,7 +53,7 @@ public async Task Should_return_audit_remotes()
var auditQuery = new AuditQuery(NullLogger<AuditQuery>.Instance, new FakeEndpointApi(), new FakeAuditCountApi(), new ConfigurationApi_ReturningOneValidAuditConfig());

//Act
var remotes = await auditQuery.GetAuditRemotes(default);
var remotes = await auditQuery.GetAuditRemotes();

//Assert
Assert.That(remotes, Is.Not.Null, "Remotes should be found");
Expand Down Expand Up @@ -81,7 +81,7 @@ public async Task Should_return_successful_audit_connection_if_instances_exist_a
var auditQuery = new AuditQuery(NullLogger<AuditQuery>.Instance, new FakeEndpointApi(), new FakeAuditCountApi(), new ConfigurationApi_ReturningOneValidAuditConfig());

//Act
var connectionSettingsResult = await auditQuery.TestAuditConnection(default);
var connectionSettingsResult = await auditQuery.TestAuditConnection();

//Assert
Assert.That(connectionSettingsResult, Is.Not.Null, "connectionSettingsResult should be returned");
Expand All @@ -103,7 +103,7 @@ public async Task Should_return_diagnostics_and_no_errors_when_no_remotes_define
var auditQuery = new AuditQuery(NullLogger<AuditQuery>.Instance, new FakeEndpointApi(), new FakeAuditCountApi(), confiApi);

//Act
var connectionSettingsResult = await auditQuery.TestAuditConnection(default);
var connectionSettingsResult = await auditQuery.TestAuditConnection();

//Assert
Assert.That(connectionSettingsResult, Is.Not.Null, "connectionSettingsResult should be returned");
Expand All @@ -128,7 +128,7 @@ public async Task Should_always_return_diagnostics_and_relevant_errors_when_inva
var auditQuery = new AuditQuery(NullLogger<AuditQuery>.Instance, new FakeEndpointApi(), new FakeAuditCountApi(), confiApi);

//Act
var connectionSettingsResult = await auditQuery.TestAuditConnection(default);
var connectionSettingsResult = await auditQuery.TestAuditConnection();

//Assert
Assert.That(connectionSettingsResult, Is.Not.Null, "connectionSettingsResult should be returned");
Expand All @@ -148,15 +148,15 @@ public async Task Should_return_correct_audit_count()
var auditQuery = new AuditQuery(NullLogger<AuditQuery>.Instance, new FakeEndpointApi(), new AuditCountApi_ReturningThreeAuditCounts(), new FakeConfigurationApi());

//Act
var auditCount = await auditQuery.GetAuditCountForEndpoint("Endpoint1", default);
var auditCount = await auditQuery.GetAuditCountForEndpoint("Endpoint1");

Assert.That(auditCount, Is.Not.Null, "AuditCount should be returned");
Assert.That(auditCount.Count, Is.EqualTo(3), "Invalid number of audit counts");
}

class ConfigurationApi_ReturningOneValidAuditConfig : IConfigurationApi
{
public Task<object> GetConfig(CancellationToken cancellationToken) => throw new NotImplementedException();
public Task<object> GetConfig(CancellationToken cancellationToken = default) => throw new NotImplementedException();

public Task<RemoteConfiguration[]> GetRemoteConfigs(CancellationToken cancellationToken = default)
{
Expand All @@ -165,12 +165,12 @@ public Task<RemoteConfiguration[]> GetRemoteConfigs(CancellationToken cancellati
return Task.FromResult<RemoteConfiguration[]>([remote]);
}

public Task<RootUrls> GetUrls(string baseUrl, CancellationToken cancellationToken) => throw new NotImplementedException();
public Task<RootUrls> GetUrls(string baseUrl, CancellationToken cancellationToken = default) => throw new NotImplementedException();
}

class ConfigurationApi_Configurable : IConfigurationApi
{
public Task<object> GetConfig(CancellationToken cancellationToken) => throw new NotImplementedException();
public Task<object> GetConfig(CancellationToken cancellationToken = default) => throw new NotImplementedException();

public Task<RemoteConfiguration[]> GetRemoteConfigs(CancellationToken cancellationToken = default)
{
Expand All @@ -184,7 +184,7 @@ public Task<RemoteConfiguration[]> GetRemoteConfigs(CancellationToken cancellati
return Task.FromResult<RemoteConfiguration[]>([remote]);
}

public Task<RootUrls> GetUrls(string baseUrl, CancellationToken cancellationToken) => throw new NotImplementedException();
public Task<RootUrls> GetUrls(string baseUrl, CancellationToken cancellationToken = default) => throw new NotImplementedException();

public bool ReturnAuditConfig { get; set; }
public string RemoteStatus { get; set; }
Expand All @@ -194,7 +194,7 @@ public Task<RemoteConfiguration[]> GetRemoteConfigs(CancellationToken cancellati

class EndpointsApi_ReturningTwoEndpoints : IEndpointsApi
{
public Task<List<Endpoint>> GetEndpoints(CancellationToken cancellationToken)
public Task<List<Endpoint>> GetEndpoints(CancellationToken cancellationToken = default)
{
return Task.FromResult<List<Endpoint>>([
new Endpoint { Id = Guid.NewGuid(), Name = "Endpoint1" },
Expand All @@ -206,7 +206,7 @@ public Task<List<Endpoint>> GetEndpoints(CancellationToken cancellationToken)

class AuditCountApi_ReturningThreeAuditCounts : IAuditCountApi
{
public async Task<IList<AuditCount>> GetEndpointAuditCounts(string endpoint, CancellationToken cancellationToken)
public async Task<IList<AuditCount>> GetEndpointAuditCounts(string endpoint, CancellationToken cancellationToken = default)
{
var auditCounts = new List<AuditCount>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ await Task.Run(async () =>
} while (!token.IsCancellationRequested);
});

Endpoint foundEndpoint = await DataStore.GetEndpoint(endpointName, ThroughputSource.Audit, default);
Endpoint foundEndpoint = await DataStore.GetEndpoint(endpointName, ThroughputSource.Audit);

//Assert
Assert.That(foundEndpoint, Is.Not.Null, $"Expected endpoint {endpointName} not found.");
Expand Down Expand Up @@ -181,9 +181,9 @@ await Task.Run(async () =>
});
await auditThroughputCollectorHostedService.StopAsync(token2);

Endpoint foundEndpoint = await DataStore.GetEndpoint(endpointName, ThroughputSource.Audit, default);
Endpoint foundEndpoint = await DataStore.GetEndpoint(endpointName, ThroughputSource.Audit);
IDictionary<string, IEnumerable<ThroughputData>> foundEndpointThroughput =
await DataStore.GetEndpointThroughputByQueueName([endpointName], default);
await DataStore.GetEndpointThroughputByQueueName([endpointName]);
ThroughputData[] throughputData = foundEndpointThroughput[endpointName].ToArray();

// Assert
Expand All @@ -210,19 +210,19 @@ class AuditQuery_NoAuditRemotes : IAuditQuery
public Func<RemoteInstanceInformation, bool> ValidRemoteInstances => r => true;

public Task<IEnumerable<AuditCount>> GetAuditCountForEndpoint(string endpointUrlName,
CancellationToken cancellationToken) => Task.FromResult<IEnumerable<AuditCount>>([]);
CancellationToken cancellationToken = default) => Task.FromResult<IEnumerable<AuditCount>>([]);

public Task<List<RemoteInstanceInformation>> GetAuditRemotes(CancellationToken cancellationToken) =>
public Task<List<RemoteInstanceInformation>> GetAuditRemotes(CancellationToken cancellationToken = default) =>
Task.FromResult<List<RemoteInstanceInformation>>([]);

public Task<IEnumerable<ServiceControlEndpoint>> GetKnownEndpoints(CancellationToken cancellationToken)
public Task<IEnumerable<ServiceControlEndpoint>> GetKnownEndpoints(CancellationToken cancellationToken = default)
{
InstanceParameter = true;

return Task.FromResult<IEnumerable<ServiceControlEndpoint>>([]);
}

public Task<ConnectionSettingsTestResult> TestAuditConnection(CancellationToken cancellationToken) =>
public Task<ConnectionSettingsTestResult> TestAuditConnection(CancellationToken cancellationToken = default) =>
Task.FromResult(
new ConnectionSettingsTestResult { ConnectionSuccessful = true, ConnectionErrorMessages = [] });

Expand All @@ -243,23 +243,23 @@ public AuditQuery_WithOneEndpoint(string endpointName, long throughputCount, Dat
public Func<RemoteInstanceInformation, bool> ValidRemoteInstances => r => true;

public Task<IEnumerable<AuditCount>> GetAuditCountForEndpoint(string endpointUrlName,
CancellationToken cancellationToken)
CancellationToken cancellationToken = default)
{
var auditCount = new AuditCount { UtcDate = ThroughputDate, Count = ThroughputCount };

return Task.FromResult(new List<AuditCount> { auditCount }.AsEnumerable());
}

public Task<List<RemoteInstanceInformation>> GetAuditRemotes(CancellationToken cancellationToken) =>
public Task<List<RemoteInstanceInformation>> GetAuditRemotes(CancellationToken cancellationToken = default) =>
Task.FromResult<List<RemoteInstanceInformation>>([]);

public Task<IEnumerable<ServiceControlEndpoint>> GetKnownEndpoints(CancellationToken cancellationToken)
public Task<IEnumerable<ServiceControlEndpoint>> GetKnownEndpoints(CancellationToken cancellationToken = default)
{
var scEndpoint = new ServiceControlEndpoint { Name = EndpointName, HeartbeatsEnabled = true };
return Task.FromResult<IEnumerable<ServiceControlEndpoint>>([scEndpoint]);
}

public Task<ConnectionSettingsTestResult> TestAuditConnection(CancellationToken cancellationToken) =>
public Task<ConnectionSettingsTestResult> TestAuditConnection(CancellationToken cancellationToken = default) =>
Task.FromResult(
new ConnectionSettingsTestResult { ConnectionSuccessful = true, ConnectionErrorMessages = [] });

Expand All @@ -275,19 +275,19 @@ class AuditQuery_ThrowingAnExceptionOnKnownEndpointsCall : IAuditQuery
public Func<RemoteInstanceInformation, bool> ValidRemoteInstances => r => true;

public Task<IEnumerable<AuditCount>> GetAuditCountForEndpoint(string endpointUrlName,
CancellationToken cancellationToken) => throw new NotImplementedException();
CancellationToken cancellationToken = default) => throw new NotImplementedException();

public Task<List<RemoteInstanceInformation>> GetAuditRemotes(CancellationToken cancellationToken) =>
public Task<List<RemoteInstanceInformation>> GetAuditRemotes(CancellationToken cancellationToken = default) =>
Task.FromResult<List<RemoteInstanceInformation>>([]);

public Task<IEnumerable<ServiceControlEndpoint>> GetKnownEndpoints(CancellationToken cancellationToken)
public Task<IEnumerable<ServiceControlEndpoint>> GetKnownEndpoints(CancellationToken cancellationToken = default)
{
InstanceParameter = true;

throw new Exception("Oops");
}

public Task<ConnectionSettingsTestResult> TestAuditConnection(CancellationToken cancellationToken) =>
public Task<ConnectionSettingsTestResult> TestAuditConnection(CancellationToken cancellationToken = default) =>
throw new NotImplementedException();

public bool InstanceParameter { get; set; }
Expand All @@ -303,17 +303,17 @@ class BrokerThroughputQuery_WithSanitization : IBrokerThroughputQuery

public KeyDescriptionPair[] Settings => throw new NotImplementedException();

public IAsyncEnumerable<IBrokerQueue> GetQueueNames(CancellationToken cancellationToken) =>
public IAsyncEnumerable<IBrokerQueue> GetQueueNames(CancellationToken cancellationToken = default) =>
throw new NotImplementedException();

public IAsyncEnumerable<QueueThroughput> GetThroughputPerDay(IBrokerQueue brokerQueue, DateOnly startDate,
CancellationToken cancellationToken) => throw new NotImplementedException();
CancellationToken cancellationToken = default) => throw new NotImplementedException();

public bool HasInitialisationErrors(out string errorMessage) => throw new NotImplementedException();
public void Initialize(ReadOnlyDictionary<string, string> settings) => throw new NotImplementedException();

public Task<(bool Success, List<string> Errors, string Diagnostics)> TestConnection(
CancellationToken cancellationToken) => throw new NotImplementedException();
CancellationToken cancellationToken = default) => throw new NotImplementedException();

public string SanitizeEndpointName(string endpointName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void Initialize(ReadOnlyDictionary<string, string> settings)
}

public async IAsyncEnumerable<QueueThroughput> GetThroughputPerDay(IBrokerQueue brokerQueue, DateOnly startDate,
[EnumeratorCancellation] CancellationToken cancellationToken)
[EnumeratorCancellation] CancellationToken cancellationToken = default)
{
GetGetThroughputPerDay++;

Expand All @@ -148,7 +148,7 @@ public async IAsyncEnumerable<QueueThroughput> GetThroughputPerDay(IBrokerQueue
}

public async IAsyncEnumerable<IBrokerQueue> GetQueueNames(
[EnumeratorCancellation] CancellationToken cancellationToken)
[EnumeratorCancellation] CancellationToken cancellationToken = default)
{
if (GetQueueNamesCalls++ % 2 == 0)
{
Expand All @@ -168,7 +168,7 @@ public async IAsyncEnumerable<IBrokerQueue> GetQueueNames(
public KeyDescriptionPair[] Settings { get; } = [];

public Task<(bool Success, List<string> Errors, string Diagnostics)> TestConnection(
CancellationToken cancellationToken) => throw new NotImplementedException();
CancellationToken cancellationToken = default) => throw new NotImplementedException();

public string SanitizeEndpointName(string endpointName) => endpointName;
public string SanitizedEndpointNameCleanser(string endpointName) => endpointName;
Expand All @@ -187,15 +187,15 @@ public void Initialize(ReadOnlyDictionary<string, string> settings)
}

public async IAsyncEnumerable<QueueThroughput> GetThroughputPerDay(IBrokerQueue brokerQueue, DateOnly startDate,
[EnumeratorCancellation] CancellationToken cancellationToken)
[EnumeratorCancellation] CancellationToken cancellationToken = default)
{
await Task.CompletedTask;

yield break;
}

public async IAsyncEnumerable<IBrokerQueue> GetQueueNames(
[EnumeratorCancellation] CancellationToken cancellationToken)
[EnumeratorCancellation] CancellationToken cancellationToken = default)
{
yield return new DefaultBrokerQueue("sales@one") { SanitizedName = "sales" };
yield return new DefaultBrokerQueue("sales@two") { SanitizedName = "sales" };
Expand All @@ -211,7 +211,7 @@ public async IAsyncEnumerable<IBrokerQueue> GetQueueNames(
public KeyDescriptionPair[] Settings { get; } = [];

public Task<(bool Success, List<string> Errors, string Diagnostics)> TestConnection(
CancellationToken cancellationToken) => throw new NotImplementedException();
CancellationToken cancellationToken = default) => throw new NotImplementedException();

public string SanitizeEndpointName(string endpointName) => endpointName;
public string SanitizedEndpointNameCleanser(string endpointName) => endpointName;
Expand All @@ -232,7 +232,7 @@ public void Initialize(ReadOnlyDictionary<string, string> settings)
}

public async IAsyncEnumerable<QueueThroughput> GetThroughputPerDay(IBrokerQueue brokerQueue, DateOnly startDate,
[EnumeratorCancellation] CancellationToken cancellationToken)
[EnumeratorCancellation] CancellationToken cancellationToken = default)
{
await Task.CompletedTask;

Expand All @@ -242,7 +242,7 @@ public async IAsyncEnumerable<QueueThroughput> GetThroughputPerDay(IBrokerQueue
}

public async IAsyncEnumerable<IBrokerQueue> GetQueueNames(
[EnumeratorCancellation] CancellationToken cancellationToken)
[EnumeratorCancellation] CancellationToken cancellationToken = default)
{
yield return new DefaultBrokerQueue("marketing");
yield return new DefaultBrokerQueue("customer");
Expand All @@ -256,7 +256,7 @@ public async IAsyncEnumerable<IBrokerQueue> GetQueueNames(
public KeyDescriptionPair[] Settings { get; } = [];

public Task<(bool Success, List<string> Errors, string Diagnostics)> TestConnection(
CancellationToken cancellationToken) => throw new NotImplementedException();
CancellationToken cancellationToken = default) => throw new NotImplementedException();

public string SanitizeEndpointName(string endpointName) => endpointName;
public string SanitizedEndpointNameCleanser(string endpointName) => endpointName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Contracts;
using Persistence;
Expand Down Expand Up @@ -122,7 +123,7 @@ public async Task Build()
{
foreach (Endpoint endpoint in endpoints)
{
await store.SaveEndpoint(endpoint, default);
await store.SaveEndpoint(endpoint);
}

;
Expand All @@ -132,7 +133,7 @@ public async Task Build()
foreach (ThroughputData throughput in throughputList)
{
await store.RecordEndpointThroughput(endpointId.Name, throughput.ThroughputSource,
throughput.Select(entry => new EndpointDailyThroughput(entry.Key, entry.Value)).ToList(), default);
throughput.Select(entry => new EndpointDailyThroughput(entry.Key, entry.Value)).ToList());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

class FakeAuditCountApi : IAuditCountApi
{
public Task<IList<ServiceControl.Api.Contracts.AuditCount>> GetEndpointAuditCounts(string endpoint, CancellationToken cancellationToken) => throw new NotImplementedException();
public Task<IList<ServiceControl.Api.Contracts.AuditCount>> GetEndpointAuditCounts(string endpoint, CancellationToken cancellationToken = default) => throw new NotImplementedException();
}
}
Loading
Loading