Merge pull request #1114 from nspcc-dev/fix-test-failures-2.x

Fix test failures 2.x
This commit is contained in:
Roman Khimov 2020-06-25 22:01:16 +03:00 committed by GitHub
commit 7e5533e77e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -246,6 +246,7 @@ func TestSubscriptions(t *testing.T) {
executionCh := make(chan *state.AppExecResult, chBufSize) executionCh := make(chan *state.AppExecResult, chBufSize)
bc := newTestChain(t) bc := newTestChain(t)
defer bc.Close()
bc.SubscribeForBlocks(blockCh) bc.SubscribeForBlocks(blockCh)
bc.SubscribeForTransactions(txCh) bc.SubscribeForTransactions(txCh)
bc.SubscribeForNotifications(notificationCh) bc.SubscribeForNotifications(notificationCh)

View file

@ -176,18 +176,18 @@ func (s *Server) Start(errChan chan error) {
s.log.Info("starting rpc-server (https)", zap.String("endpoint", s.https.Addr)) s.log.Info("starting rpc-server (https)", zap.String("endpoint", s.https.Addr))
go func() { go func() {
err := s.https.ListenAndServeTLS(cfg.CertFile, cfg.KeyFile) err := s.https.ListenAndServeTLS(cfg.CertFile, cfg.KeyFile)
if err != nil { if err != http.ErrServerClosed {
s.log.Error("failed to start TLS RPC server", zap.Error(err)) s.log.Error("failed to start TLS RPC server", zap.Error(err))
}
errChan <- err errChan <- err
}
}() }()
} }
err := s.ListenAndServe() err := s.ListenAndServe()
if err != nil { if err != http.ErrServerClosed {
s.log.Error("failed to start RPC server", zap.Error(err)) s.log.Error("failed to start RPC server", zap.Error(err))
}
errChan <- err errChan <- err
} }
}
// Shutdown overrides the http.Server Shutdown // Shutdown overrides the http.Server Shutdown
// method. // method.