From 2fdf0a64dbf3c571150277a6de3f8c71aa86c41e Mon Sep 17 00:00:00 2001 From: Piotr Piotrowski Date: Mon, 28 Aug 2023 12:50:22 +0200 Subject: [PATCH] Fix watcher test to use UpdatesOnly Signed-off-by: Piotr Piotrowski --- test/compat_test.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/test/compat_test.go b/test/compat_test.go index e354faa7e..978bdfc96 100644 --- a/test/compat_test.go +++ b/test/compat_test.go @@ -1,13 +1,9 @@ -//go:build compat -// +build compat - package test import ( "bytes" "crypto/sha256" "encoding/json" - "fmt" "io" "net/http" "os" @@ -225,8 +221,6 @@ func TestCompatibilityObjectStoreUpdateMetadata(t *testing.T) { } func TestCompatibilityObjectStoreWatchUpdates(t *testing.T) { - // Skipped until watching only for changes only is added. - t.Skip() t.Parallel() type config struct { @@ -257,15 +251,13 @@ func TestCompatibilityObjectStoreWatchUpdates(t *testing.T) { if err != nil { t.Fatalf("Error getting object store: %v", err) } - time.Sleep(5 * time.Second) - watcher, err := os.Watch() + watcher, err := os.Watch(nats.UpdatesOnly()) if err != nil { t.Fatalf("Error getting watcher: %v", err) } var info *nats.ObjectInfo select { case info = <-watcher.Updates(): - fmt.Println(info.Digest) case <-time.After(30 * time.Second): t.Fatalf("Timeout waiting for object update") }