Skip to content

Commit

Permalink
Fix TestIncrementalReconfig
Browse files Browse the repository at this point in the history
This test was broken by the new error format returned by the connection
  • Loading branch information
PapaCharlie committed Feb 5, 2024
1 parent da4f072 commit d93f41b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# make file to hold the logic of build and test setup
ZK_VERSION ?= 3.6.3
export ZK_VERSION ?= 3.6.3

# Apache changed the name of the archive in version 3.5.x and seperated out
# src and binary packages
Expand Down
4 changes: 2 additions & 2 deletions zk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func TestIncrementalReconfig(t *testing.T) {

// remove node 3.
_, err = zk.IncrementalReconfig(nil, []string{"3"}, -1)
if err != nil && err == ErrConnectionClosed {
if err != nil && errors.Is(err, ErrConnectionClosed) {
t.Log("conneciton closed is fine since the cluster re-elects and we dont reconnect")
} else {
requireNoErrorf(t, err, "failed to remove node from cluster")
Expand All @@ -268,7 +268,7 @@ func TestIncrementalReconfig(t *testing.T) {
// add node a new 4th node
server := fmt.Sprintf("server.%d=%s:%d:%d;%d", testSrvConfig.ID, testSrvConfig.Host, testSrvConfig.PeerPort, testSrvConfig.LeaderElectionPort, cfg.ClientPort)
_, err = zk.IncrementalReconfig([]string{server}, nil, -1)
if err != nil && err == ErrConnectionClosed {
if err != nil && errors.Is(err, ErrConnectionClosed) {
t.Log("conneciton closed is fine since the cluster re-elects and we dont reconnect")
} else {
requireNoErrorf(t, err, "failed to add new server to cluster")
Expand Down

0 comments on commit d93f41b

Please sign in to comment.