From f7651e3a268e112d37e8a15458adda3b17cbbb30 Mon Sep 17 00:00:00 2001 From: Matthew Jaffee Date: Thu, 28 Apr 2022 13:00:05 -0500 Subject: [PATCH] update tests to reflect recent changes around allowing things when nodes are UNKNOWN --- server/server_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/server_test.go b/server/server_test.go index ba4c26171..0c5970381 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -543,7 +543,11 @@ func TestClusteringNodesReplica1(t *testing.T) { Query: fmt.Sprintf("Row(%s=1)", fieldName), } - if _, err := cluster.GetPrimary().API.Query(context.Background(), qry); !strings.Contains(err.Error(), "shard unavailable") { + // check for connection refused... this used to check 'shard + // unavailable', but we since made a change to allow queries to + // nodes which the cluster *thinks* are down, but often are + // actually not. + if _, err := cluster.GetPrimary().API.Query(context.Background(), qry); !strings.Contains(err.Error(), "connection refused") { t.Fatalf("got unexpected error querying an incomplete cluster: %v", err) } } @@ -636,7 +640,11 @@ func TestClusteringNodesReplica2(t *testing.T) { // the query to result in an error, we check that it's the error we expect. resp, err := coord.API.Query(context.Background(), qry) if err != nil { - if !strings.Contains(err.Error(), "shard unavailable") { + // check for connection refused... this used to check 'shard + // unavailable', but we since made a change to allow queries to + // nodes which the cluster *thinks* are down, but often are + // actually not. + if !strings.Contains(err.Error(), "connection refused") { t.Fatalf("got unexpected error querying an incomplete cluster: %v", err) } } else {