Fix what the independent review of Phase 7 found and close the phase (refs #61)
ci / test (postgres) (push) Successful in 4m14s
ci / test (sqlite) (push) Successful in 4m41s
ci / test (postgres) (pull_request) Successful in 4m22s
ci / test (sqlite) (pull_request) Successful in 4m33s
ci / image (push) Successful in 2m51s
ci / image (pull_request) Successful in 50s

Linking missed Italian elisions, "The" names and common aliases; keywords
missed words after an apostrophe; stories about two companies merged and
confirmed each other; a story that became serious late was measured from its
first article. The news round delayed the engine and the risk check, and the
classifier ran inside the database writer. The earnings row started and ended
on the wrong sessions, the one-step comparison ignored it, and a purchase was
said to be put off when it was not, or sent at the open. ADR 0017 records the
choices; what depends on the user is in #107 and #55.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-12-01 09:49:14 +01:00
1 parent 61878c2023
commit a3ff8ea6b7
22 files changed
+862 -123

No files matched your search

+45
View File
@@ -218,6 +218,51 @@ public sealed class SchedulerTests
Assert.AreEqual(Rome(2026, 10, 12, 3, 30), scheduler.Upcoming().Single(u => u.Name == "backup").DueUtc);
}
/// <summary>A long job beside the queue (the news) never delays the others, never runs twice at once, and is waited for.</summary>
[TestMethod]
[TestCategory(Category.Unit)]
public async Task AJobBesideTheQueueNeverDelaysTheOthers()
{
var clock = new ManualClock(new DateTimeOffset(2026, 10, 9, 6, 21, 0, TimeSpan.Zero));
var bus = new EventBus();
using var runs = bus.Subscribe<JobRun>();
var scheduler = new Scheduler(clock, bus);
int slow = 0, quick = 0;
var release = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
scheduler.Add(new ScheduledJob("a-notizie", "Lunga", Schedule.Every(TimeSpan.FromMinutes(1)), async ct =>
{
Interlocked.Increment(ref slow);
await release.Task.WaitAsync(ct).ConfigureAwait(false);
})
{ Beside = true });
scheduler.Add(new ScheduledJob("rischio", "Breve", Schedule.Every(TimeSpan.FromMinutes(1)), _ =>
{
quick++;
return Task.CompletedTask;
}));
for (var minute = 22; minute <= 24; minute++)
{
clock.Set(new DateTimeOffset(2026, 10, 9, 6, minute, 0, TimeSpan.Zero));
await scheduler.RunDueAsync(CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(10)).ConfigureAwait(false);
}
await WaitUntil(() => Volatile.Read(ref slow) == 1).ConfigureAwait(false);
Assert.AreEqual((1, 3), (slow, quick));
release.SetResult();
await scheduler.BesideAsync().WaitAsync(TimeSpan.FromSeconds(10)).ConfigureAwait(false);
clock.Set(new DateTimeOffset(2026, 10, 9, 6, 25, 0, TimeSpan.Zero));
await scheduler.RunDueAsync(CancellationToken.None).ConfigureAwait(false);
await scheduler.BesideAsync().WaitAsync(TimeSpan.FromSeconds(10)).ConfigureAwait(false);
Assert.AreEqual(2, slow);
var done = new List<JobRun>();
while (runs.TryRead(out var run))
{
done.Add(run!);
}
Assert.AreEqual(2, done.Count(r => r.Name == "a-notizie" && r.Outcome == JobOutcome.Completed));
}
[TestMethod]
[TestCategory(Category.Unit)]
public async Task LoopWaitsOnTheInjectedClock()