Skip to content

Commit

Permalink
Fix some CI failures
Browse files Browse the repository at this point in the history
  • Loading branch information
ejortegau committed Sep 17, 2024
1 parent 03534de commit 96ddad1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
15 changes: 7 additions & 8 deletions go/vt/discovery/topology_watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"math/rand"
"testing"
"time"

"vitess.io/vitess/go/vt/logutil"
"vitess.io/vitess/go/vt/topo"

Expand Down Expand Up @@ -109,7 +110,9 @@ func TestCellTabletsWatcherNoRefreshKnown(t *testing.T) {

func checkWatcher(t *testing.T, refreshKnownTablets bool) {
ts := memorytopo.NewServer("aa")
defer ts.Close()
fhc := NewFakeHealthCheck(nil)
defer fhc.Close()
logger := logutil.NewMemoryLogger()
topologyWatcherOperations.ZeroAll()
counts := topologyWatcherOperations.Counts()
Expand Down Expand Up @@ -190,14 +193,10 @@ func checkWatcher(t *testing.T, refreshKnownTablets bool) {
key = TabletToMapKey(tablet)

if refreshKnownTablets {
counts = checkOpCounts(t, counts, map[string]int64{"ListTablets": 1, "GetTablet": 2, "ReplaceTablet": 1})

if _, ok := allTablets[key]; !ok || len(allTablets) != 2 || !proto.Equal(allTablets[key], tablet) {
t.Errorf("fhc.GetAllTablets() = %+v; want %+v", allTablets, tablet)
}
if _, ok := allTablets[origKey]; ok {
t.Errorf("fhc.GetAllTablets() = %+v; don't want %v", allTablets, origKey)
}
assert.Len(t, allTablets, 2)
assert.Contains(t, allTablets, key)
assert.True(t, proto.Equal(tablet, allTablets[key]))
assert.NotContains(t, allTablets, origKey)
checkChecksum(t, tw, 2762153755)
} else {
counts = checkOpCounts(t, counts, map[string]int64{"ListTablets": 1, "GetTablet": 0, "ReplaceTablet": 0})
Expand Down
3 changes: 2 additions & 1 deletion go/vt/topo/tablet.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ package topo
import (
"context"
"fmt"
"golang.org/x/sync/semaphore"
"path"
"sort"
"sync"
"time"

"golang.org/x/sync/semaphore"

"vitess.io/vitess/go/vt/key"

"vitess.io/vitess/go/vt/proto/vtrpc"
Expand Down

0 comments on commit 96ddad1

Please sign in to comment.