Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
shanth96 committed Oct 25, 2024
1 parent ab7cd0e commit fe5eaf8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions go/vt/topo/zk2topo/zk_conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"testing"

"github.com/z-division/go-zookeeper/zk"

"vitess.io/vitess/go/testfiles"
"vitess.io/vitess/go/vt/zkctl"
)
Expand All @@ -36,7 +35,7 @@ func TestZkConnClosedOnDisconnect(t *testing.T) {
t.Fatalf("Get() failed: %v", err)
}

if conn.conn.State() != zk.StateConnected {
if !conn.conn.State().IsConnected() {
t.Fatalf("Connection not connected: %v", conn.conn.State())
}

Expand All @@ -52,7 +51,12 @@ func TestZkConnClosedOnDisconnect(t *testing.T) {
t.Fatalf("Get() failed: %v", err)
}

// check that the old connection is closed
// Check that old connection is closed
_, _, err = oldConn.Get("/")
if err == nil {
t.Fatalf("Get() should have failed: %v", err)
}

if oldConn.State() != zk.StateDisconnected {
t.Fatalf("Connection not closed: %v", oldConn.State())
}
Expand Down

0 comments on commit fe5eaf8

Please sign in to comment.