test: probe branches, local upload errors, upstream errors, rpm/gc error paths

This commit is contained in:
2026-07-03 13:22:24 +10:00
parent 3d80837539
commit 6bcda813fd
4 changed files with 100 additions and 10 deletions
+18
View File
@@ -94,3 +94,21 @@ func TestSweepNoOrphans(t *testing.T) {
// A sweep with nothing to collect should be a clean no-op.
New(testDB, testStore, time.Hour).sweep(context.Background())
}
func TestRunStopsOnContextCancel(t *testing.T) {
if testDB == nil {
t.Skip("Docker unavailable")
}
ctx, cancel := context.WithCancel(context.Background())
done := make(chan struct{})
go func() {
New(testDB, testStore, time.Hour).Run(ctx)
close(done)
}()
cancel()
select {
case <-done:
case <-time.After(5 * time.Second):
t.Fatal("Run did not return after context cancel")
}
}