Maybe rest of linter errors

This commit is contained in:
Geoff Stuart 2022-11-25 16:36:33 -05:00
parent d2b7c3889b
commit f04aca767f
6 changed files with 20 additions and 4 deletions

View File

@ -421,7 +421,12 @@ var runCmd = &cli.Command{
},
Action: func(cctx *cli.Context) error {
go func() {
_ = http.ListenAndServe(":6060", nil)
server := &http.Server{
Addr: ":6060",
ReadHeaderTimeout: 3 * time.Second,
}
_ = server.ListenAndServe()
}()
ctx := context.Background()

View File

@ -9,6 +9,7 @@ import (
"net/http/httptest"
"os"
"os/exec"
"time"
"github.com/chzyer/readline"
"github.com/urfave/cli/v2"
@ -46,7 +47,7 @@ var itestdCmd = &cli.Command{
}
s := &httptest.Server{
Listener: l,
Config: &http.Server{Handler: m},
Config: &http.Server{Handler: m, ReadHeaderTimeout: 3 * time.Second},
}
s.Start()
fmt.Printf("ITest env:\n\nLOTUS_ITESTD=%s\n\nSay 'sh' to spawn a shell connected to test nodes\n--- waiting for clients\n", s.URL)

View File

@ -121,6 +121,10 @@ var multisigGetAllCmd = &cli.Command{
}
return nil
})
if err != nil {
return err
}
out, err := json.MarshalIndent(msigActorsInfo, "", " ")
if err != nil {
return err

View File

@ -7,6 +7,7 @@ import (
"net/http"
"net/http/httptest"
"testing"
"time"
"github.com/multiformats/go-multiaddr"
manet "github.com/multiformats/go-multiaddr/net"
@ -22,7 +23,10 @@ type Closer func()
func CreateRPCServer(t *testing.T, handler http.Handler, listener net.Listener) (*httptest.Server, multiaddr.Multiaddr, Closer) {
testServ := &httptest.Server{
Listener: listener,
Config: &http.Server{Handler: handler},
Config: &http.Server{
Handler: handler,
ReadHeaderTimeout: 3 * time.Second,
},
}
testServ.Start()

View File

@ -199,6 +199,7 @@ func TestMigrationNV17(t *testing.T) {
require.NoError(t, err)
sig, err := clientApi.WalletSign(ctx, verifiedClientAddr, serializedProposal.Bytes())
require.NoError(t, err)
publishDealParams := markettypes.PublishStorageDealsParams{
Deals: []markettypes.ClientDealProposal{{
@ -405,6 +406,7 @@ func TestMigrationNV17(t *testing.T) {
require.NoError(t, err)
sig, err = clientApi.WalletSign(ctx, verifiedClientAddr, serializedProposal.Bytes())
require.NoError(t, err)
publishDealParams = markettypes.PublishStorageDealsParams{
Deals: []markettypes.ClientDealProposal{{

View File

@ -284,7 +284,7 @@ func (rw *raftWrapper) WaitForLeader(ctx context.Context) (string, error) {
func (rw *raftWrapper) WaitForVoter(ctx context.Context) error {
logger.Debug("waiting until we are promoted to a voter")
pid := hraft.ServerID(peer.Encode(rw.host.ID()))
pid := hraft.ServerID(rw.host.ID().String())
for {
select {
case <-ctx.Done():