Skip to content

Commit 0489d57

Browse files
committed
fixed tests to match new output
1 parent 911e34f commit 0489d57

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

cmd/hauler/cli/store/sync_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,7 @@ func TestSyncImages_ErrorPropagation(t *testing.T) {
20332033
// goroutine has fully returned (including cancelling gctx on failure), so
20342034
// jobs run strictly in slice order and the good jobs are guaranteed to
20352035
// observe the already-cancelled context before doing anything.
2036-
func TestRunImageJobs_CancelledJobsDoNotLogAddingImage(t *testing.T) {
2036+
func TestRunImageJobs_CancelledJobsDoNotLogResolvingImage(t *testing.T) {
20372037
host, remoteOpts := newTestRegistry(t)
20382038

20392039
const nGood = 3
@@ -2047,8 +2047,9 @@ func TestRunImageJobs_CancelledJobsDoNotLogAddingImage(t *testing.T) {
20472047

20482048
s := newTestStore(t)
20492049
var buf bytes.Buffer
2050-
// "adding image [...]" now logs at Debug (cmd/hauler/cli/store/add.go),
2051-
// so this test needs Debug-level output visible. Per-logger .Level() is
2050+
// "resolving image [...]" (storeImage's per-job startup line in
2051+
// cmd/hauler/cli/store/add.go) logs at Debug, so this test needs
2052+
// Debug-level output visible. Per-logger .Level() is
20522053
// not sufficient on its own: zerolog's Logger.should() gates on
20532054
// max(logger.level, zerolog.GlobalLevel()) -- and GlobalLevel is
20542055
// process-global state that other tests in this package mutate (e.g.
@@ -2073,9 +2074,9 @@ func TestRunImageJobs_CancelledJobsDoNotLogAddingImage(t *testing.T) {
20732074
t.Fatal("runImageJobs: expected error, got nil")
20742075
}
20752076

2076-
got := strings.Count(buf.String(), "adding image [")
2077+
got := strings.Count(buf.String(), "resolving image [")
20772078
if got != 1 {
2078-
t.Errorf("\"adding image [\" logged %d times, want exactly 1 (only the failed job should have attempted logging; the %d good jobs queued after it must never start)\nfull log:\n%s", got, nGood, buf.String())
2079+
t.Errorf("\"resolving image [\" logged %d times, want exactly 1 (only the failed job should have attempted logging; the %d good jobs queued after it must never start)\nfull log:\n%s", got, nGood, buf.String())
20792080
}
20802081
}
20812082

0 commit comments

Comments
 (0)