diff --git a/storage/gcp/gcp_test.go b/storage/gcp/gcp_test.go index cdfe62a2..be96d4e0 100644 --- a/storage/gcp/gcp_test.go +++ b/storage/gcp/gcp_test.go @@ -346,13 +346,16 @@ func TestPublishCheckpoint(t *testing.T) { if err := storage.init(ctx); err != nil { t.Fatalf("storage.init: %v", err) } - m.delete(layout.CheckpointPath) + cpOld := []byte("bananas") + if err := m.setObject(ctx, layout.CheckpointPath, cpOld, nil, ""); err != nil { + t.Fatalf("setObject(bananas): %v", err) + } m.lMod = test.cpModifiedAt if err := storage.publishCheckpoint(ctx, test.publishInterval); err != nil { t.Fatalf("publishCheckpoint: %v", err) } - _, _, err := m.getObject(ctx, layout.CheckpointPath) - cpUpdated := true + cpNew, _, err := m.getObject(ctx, layout.CheckpointPath) + cpUpdated := !bytes.Equal(cpOld, cpNew) if err != nil { if !errors.Is(err, gcs.ErrObjectNotExist) { t.Fatalf("getObject: %v", err)