Skip to content

Commit 1d126c6

Browse files
authored
[Bugfix] Fix ActiveFailover instance check (#282)
1 parent 8ad4e0c commit 1d126c6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

service/service.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,10 @@ func (s *Service) TestInstance(ctx context.Context, serverType definitions.Serve
729729

730730
resp, err := c.Do(ctx, req)
731731
if err != nil {
732+
if driver.IsNoLeader(err) {
733+
// Server is up, just not the leader
734+
return false, nil
735+
}
732736
return false, maskAny(err)
733737
}
734738
if resp.StatusCode() == 200 {

test/server_util.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ import (
2626
"context"
2727
"crypto/tls"
2828
"fmt"
29-
"github.com/pkg/errors"
3029
"net"
3130
"net/http"
3231
"testing"
3332
"time"
3433

34+
"github.com/pkg/errors"
35+
3536
"github.com/arangodb-helper/arangodb/client"
3637
"github.com/arangodb-helper/arangodb/service"
3738
"github.com/arangodb/go-driver"

0 commit comments

Comments
 (0)