Review of 083: an upgrade handled during shutdown is left for the broker; an enrolment cut short by shutdown is told to try again; a refused redelivery says what it probably is

This commit is contained in:
2026-09-22 14:39:15 +02:00
parent 32b8af6a9b
commit 4f3b4e6014
3 changed files with 28 additions and 1 deletions
+14
View File
@@ -165,3 +165,17 @@ func TestWhatIsHeldLeavesRoomInThePrefetch(t *testing.T) {
t.Fatalf("a message past the ceiling was held: %+v", *last)
}
}
// An upgrade handled during shutdown is left for the broker too — the upgrader's error is the
// cancelled context, which is no answer about the announcement.
func TestAnUpgradeHandledDuringShutdownIsLeftForTheBroker(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
cancel()
s := quietServer()
s.upgrader = upgradesWith{err: context.Canceled}
to := &settledAs{}
s.upgraded(ctx, a(t, to, "upgraded", Upgraded{Module: "gitea", Commit: "abcdef0123"}))
if !to.held() {
t.Fatalf("an upgrade handled during shutdown was settled, and so lost: %+v", *to)
}
}