lower the p2p peer count minimum for a successful status (#2179)

This commit is contained in:
Preston Van Loon 2019-04-05 15:09:05 -05:00 committed by Raul Jordan
parent 0bd4489bc3
commit 3ec9fc0b8f
2 changed files with 4 additions and 4 deletions

View File

@ -164,8 +164,8 @@ func (s *Server) Stop() error {
// Status returns an error if the p2p service does not have sufficient peers.
func (s *Server) Status() error {
if peerCount(s.host) < 5 {
return errors.New("less than 5 peers")
if peerCount(s.host) < 3 {
return errors.New("less than 3 peers")
}
return nil
}

View File

@ -418,14 +418,14 @@ func TestRegisterTopic_HandlesPanic(t *testing.T) {
}
func TestStatus_MinimumPeers(t *testing.T) {
minPeers := 5
minPeers := 3
ctx := context.Background()
h := bhost.NewBlankHost(swarmt.GenSwarm(t, ctx))
s := Server{host: h}
err := s.Status()
if err == nil || err.Error() != "less than 5 peers" {
if err == nil || err.Error() != "less than 3 peers" {
t.Errorf("p2p server did not return expected status, instead returned %v", err)
}