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 { Action: func(cctx *cli.Context) error {
go func() { go func() {
_ = http.ListenAndServe(":6060", nil) server := &http.Server{
Addr: ":6060",
ReadHeaderTimeout: 3 * time.Second,
}
_ = server.ListenAndServe()
}() }()
ctx := context.Background() ctx := context.Background()

View File

@ -9,6 +9,7 @@ import (
"net/http/httptest" "net/http/httptest"
"os" "os"
"os/exec" "os/exec"
"time"
"github.com/chzyer/readline" "github.com/chzyer/readline"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
@ -46,7 +47,7 @@ var itestdCmd = &cli.Command{
} }
s := &httptest.Server{ s := &httptest.Server{
Listener: l, Listener: l,
Config: &http.Server{Handler: m}, Config: &http.Server{Handler: m, ReadHeaderTimeout: 3 * time.Second},
} }
s.Start() 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) 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 return nil
}) })
if err != nil {
return err
}
out, err := json.MarshalIndent(msigActorsInfo, "", " ") out, err := json.MarshalIndent(msigActorsInfo, "", " ")
if err != nil { if err != nil {
return err return err

View File

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

View File

@ -199,6 +199,7 @@ func TestMigrationNV17(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
sig, err := clientApi.WalletSign(ctx, verifiedClientAddr, serializedProposal.Bytes()) sig, err := clientApi.WalletSign(ctx, verifiedClientAddr, serializedProposal.Bytes())
require.NoError(t, err)
publishDealParams := markettypes.PublishStorageDealsParams{ publishDealParams := markettypes.PublishStorageDealsParams{
Deals: []markettypes.ClientDealProposal{{ Deals: []markettypes.ClientDealProposal{{
@ -405,6 +406,7 @@ func TestMigrationNV17(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
sig, err = clientApi.WalletSign(ctx, verifiedClientAddr, serializedProposal.Bytes()) sig, err = clientApi.WalletSign(ctx, verifiedClientAddr, serializedProposal.Bytes())
require.NoError(t, err)
publishDealParams = markettypes.PublishStorageDealsParams{ publishDealParams = markettypes.PublishStorageDealsParams{
Deals: []markettypes.ClientDealProposal{{ 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 { func (rw *raftWrapper) WaitForVoter(ctx context.Context) error {
logger.Debug("waiting until we are promoted to a voter") 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 { for {
select { select {
case <-ctx.Done(): case <-ctx.Done():