Skip to content

Commit

Permalink
Fix watcher test to use UpdatesOnly
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Piotrowski <[email protected]>
  • Loading branch information
piotrpio committed Aug 28, 2023
1 parent c9443dd commit 2fdf0a6
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions test/compat_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
//go:build compat
// +build compat

package test

import (
"bytes"
"crypto/sha256"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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")
}
Expand Down

0 comments on commit 2fdf0a6

Please sign in to comment.