diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 1542cd7..7845fb7 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -20,6 +20,7 @@ jobs: timeout-minutes: 10 strategy: + fail-fast: false matrix: os: [ ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest ] diff --git a/tests/NCronJob.Tests/NCronJobIntegrationTests.cs b/tests/NCronJob.Tests/NCronJobIntegrationTests.cs index 39f9381..186620b 100644 --- a/tests/NCronJob.Tests/NCronJobIntegrationTests.cs +++ b/tests/NCronJob.Tests/NCronJobIntegrationTests.cs @@ -290,10 +290,10 @@ public async Task WhileAwaitingJobTriggeringInstantJobShouldAnywayTriggerCronJob await provider.GetRequiredService().StartAsync(CancellationToken); - // Added here not in the source code: - // To enable processing time - await Task.Delay(100, CancellationToken); - FakeTimer.Advance(TimeSpan.FromMilliseconds(100)); + //// Added here not in the source code: + //// To enable processing time + //await Task.Delay(100, CancellationToken); + //FakeTimer.Advance(TimeSpan.FromMilliseconds(100)); Guid instantOrchestrationId = provider.GetRequiredService().RunInstantJob(token: CancellationToken); @@ -322,6 +322,50 @@ public async Task WhileAwaitingJobTriggeringInstantJobShouldAnywayTriggerCronJob Assert.Equal(ExecutionState.OrchestrationCompleted, instantOrchestrationEvents[6].State); Assert.Equal(7, instantOrchestrationEvents.Count); + /* + 24.04 arm + s 0 2000-01-01T00:00:00.0000000+00:00 + i 0 2000-01-01T00:00:01.0000000+00:00 + s 3 2000-01-01T00:00:01.0000000+00:00 + i 2 2000-01-01T00:00:01.0000000+00:00 <----- + s 4 2000-01-01T00:00:01.0000000+00:00 + i 6 2000-01-01T00:00:01.1924400+00:00 + + 24.04 + s 0 2000-01-01T00:00:00.0000000+00:00 + i 0 2000-01-01T00:00:01.0000000+00:00 + s 3 2000-01-01T00:00:01.0000000+00:00 + i 2 2000-01-01T00:00:01.0602800+00:00 + s 4 2000-01-01T00:00:01.0000000+00:00 + i 6 2000-01-01T00:00:01.1467200+00:00 + + win + s 0 2000-01-01T00:00:00.0000000+00:00 + i 0 2000-01-01T00:00:01.0000000+00:00 + s 3 2000-01-01T00:00:01.0000000+00:00 + i 2 2000-01-01T00:00:01.0093100+00:00 + s 4 2000-01-01T00:00:01.0000000+00:00 + i 6 2000-01-01T00:00:02.2306000+00:00 + + macos + s 0 2000-01-01T00:00:00.0000000+00:00 + i 0 2000-01-01T00:00:01.0000000+00:00 + s 3 2000-01-01T00:00:01.0000000+00:00 + i 2 2000-01-01T00:00:01.0014600+00:00 + s 4 2000-01-01T00:00:01.0000000+00:00 + i 6 2000-01-01T00:00:01.6099300+00:00 + */ + + + TestContext.Current.TestOutputHelper!.WriteLine($"s 0 {scheduledOrchestrationEvents[0].Timestamp:o}"); + TestContext.Current.TestOutputHelper!.WriteLine($"i 0 {instantOrchestrationEvents[0].Timestamp:o}"); + + TestContext.Current.TestOutputHelper!.WriteLine($"s 3 {scheduledOrchestrationEvents[3].Timestamp:o}"); + TestContext.Current.TestOutputHelper!.WriteLine($"i 2 {instantOrchestrationEvents[2].Timestamp:o}"); + + TestContext.Current.TestOutputHelper!.WriteLine($"s 4 {scheduledOrchestrationEvents[4].Timestamp:o}"); + TestContext.Current.TestOutputHelper!.WriteLine($"i 6 {instantOrchestrationEvents[6].Timestamp:o}"); + // Scheduled orchestration should have started before the instant job related one... Assert.True(scheduledOrchestrationEvents[0].Timestamp < instantOrchestrationEvents[0].Timestamp); diff --git a/tests/NCronJob.Tests/TestHelper.cs b/tests/NCronJob.Tests/TestHelper.cs index aabeb4c..596b8fe 100644 --- a/tests/NCronJob.Tests/TestHelper.cs +++ b/tests/NCronJob.Tests/TestHelper.cs @@ -20,7 +20,7 @@ private readonly CancellationTokenSource cancellationTokenSource protected CancellationToken CancellationToken => cancellationTokenSource.Token; protected Channel CommunicationChannel { get; } = Channel.CreateUnbounded(); protected ServiceCollection ServiceCollection { get; } - protected FakeTimeProvider FakeTimer { get; } = new(); + protected FakeTimeProvider FakeTimer { get; } = new() { AutoAdvanceAmount = TimeSpan.FromMilliseconds(1) }; protected JobIntegrationBase() {