core: pin the history store clock in fixed-date tests
agent-review agent review: pass

Storage, rework and limit-analysis tests add Claude events with fixed
2026-10-14 timestamps to a HistoryStore on the system clock. The 60-day
Claude retention would drop them from mid-December 2026 on, so these
stores now use TestClock.

Refs #11
This commit is contained in:
Florian Schmidt
2026-10-17 09:24:52 +02:00
parent 312db4e0b8
commit 0549e862c5
3 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -90,11 +90,11 @@ public class ReworkTests
using var directory = new TestDirectory();
var source = directory.Write("claude/projects/p/a.jsonl", Fixtures.Claude());
var log = new DiagnosticLog();
var store = new HistoryStore(directory.Path, log);
var store = new HistoryStore(directory.Path, log, new TestClock());
var scanner = new IncrementalScanner(store, log, Path.Combine(directory.Path, "claude"), directory.Path);
Assert.Equal(1, (await scanner.ScanAsync(TestContext.Current.CancellationToken)).AddedEvents);
await store.SaveAsync(TestContext.Current.CancellationToken);
store = new(directory.Path, log);
store = new(directory.Path, log, new TestClock());
scanner = new(store, log, Path.Combine(directory.Path, "claude"), directory.Path);
using var exclusive = new FileStream(source, FileMode.Open, FileAccess.Read, FileShare.None);
Assert.Equal(0, (await scanner.ScanAsync(TestContext.Current.CancellationToken)).AddedEvents);