From d93f41b97e0afe1e904a42409be19d627515ca6c Mon Sep 17 00:00:00 2001 From: PapaCharlie Date: Mon, 5 Feb 2024 12:39:48 -0800 Subject: [PATCH] Fix TestIncrementalReconfig This test was broken by the new error format returned by the connection --- Makefile | 2 +- zk_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 20a40f7a..7b90c217 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/zk_test.go b/zk_test.go index 75c69ecb..2073a715 100644 --- a/zk_test.go +++ b/zk_test.go @@ -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") @@ -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")