From 621fd4030a7e356251c0381daf133bdef47b2a59 Mon Sep 17 00:00:00 2001 From: Al Cutter Date: Thu, 21 Nov 2024 16:56:11 +0000 Subject: [PATCH] Tighen GCP test --- storage/gcp/gcp_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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)