diff --git a/cmd/tendermint/commands/inspect.go b/cmd/tendermint/commands/inspect.go index 1b9091148..de31d33d4 100644 --- a/cmd/tendermint/commands/inspect.go +++ b/cmd/tendermint/commands/inspect.go @@ -19,7 +19,7 @@ import ( // InspectCmd is the command for starting an inspect server. var InspectCmd = &cobra.Command{ Use: "inspect", - Short: "Run an inspect server for investigating Tendermint state.", + Short: "Run an inspect server for investigating Tendermint state", Long: ` inspect runs a subset of Tendermint's RPC endpoints that are useful for debugging issues with Tendermint. diff --git a/inspect/inspect_test.go b/inspect/inspect_test.go index f6ba72932..5f4d4d3b4 100644 --- a/inspect/inspect_test.go +++ b/inspect/inspect_test.go @@ -83,8 +83,9 @@ func TestBlock(t *testing.T) { defer wg.Done() require.NoError(t, d.Run(ctx)) }() - // force context switch - time.Sleep(10 * time.Millisecond) + // FIXME: used to induce context switch. + // Determine more deterministic method for prompting a context switch + time.Sleep(time.Microsecond) requireConnect(t, rpcConfig.ListenAddress, 15) cli, err := httpclient.New(rpcConfig.ListenAddress) require.NoError(t, err) @@ -208,8 +209,9 @@ func TestConsensusParams(t *testing.T) { defer wg.Done() require.NoError(t, d.Run(ctx)) }() - // force context switch - time.Sleep(10 * time.Millisecond) + // FIXME: used to induce context switch. + // Determine more deterministic method for prompting a context switch + time.Sleep(time.Microsecond) requireConnect(t, rpcConfig.ListenAddress, 15) cli, err := httpclient.New(rpcConfig.ListenAddress) require.NoError(t, err) @@ -254,8 +256,9 @@ func TestBlockResults(t *testing.T) { defer wg.Done() require.NoError(t, d.Run(ctx)) }() - // force context switch - time.Sleep(10 * time.Millisecond) + // FIXME: used to induce context switch. + // Determine more deterministic method for prompting a context switch + time.Sleep(time.Microsecond) requireConnect(t, rpcConfig.ListenAddress, 15) cli, err := httpclient.New(rpcConfig.ListenAddress) require.NoError(t, err) @@ -295,8 +298,9 @@ func TestCommit(t *testing.T) { defer wg.Done() require.NoError(t, d.Run(ctx)) }() - // force context switch - time.Sleep(10 * time.Millisecond) + // FIXME: used to induce context switch. + // Determine more deterministic method for prompting a context switch + time.Sleep(time.Microsecond) requireConnect(t, rpcConfig.ListenAddress, 15) cli, err := httpclient.New(rpcConfig.ListenAddress) require.NoError(t, err) @@ -342,8 +346,9 @@ func TestBlockByHash(t *testing.T) { defer wg.Done() require.NoError(t, d.Run(ctx)) }() - // force context switch - time.Sleep(10 * time.Millisecond) + // FIXME: used to induce context switch. + // Determine more deterministic method for prompting a context switch + time.Sleep(time.Microsecond) requireConnect(t, rpcConfig.ListenAddress, 15) cli, err := httpclient.New(rpcConfig.ListenAddress) require.NoError(t, err) @@ -388,8 +393,9 @@ func TestBlockchain(t *testing.T) { defer wg.Done() require.NoError(t, d.Run(ctx)) }() - // force context switch - time.Sleep(10 * time.Millisecond) + // FIXME: used to induce context switch. + // Determine more deterministic method for prompting a context switch + time.Sleep(time.Microsecond) requireConnect(t, rpcConfig.ListenAddress, 15) cli, err := httpclient.New(rpcConfig.ListenAddress) require.NoError(t, err) @@ -434,8 +440,9 @@ func TestValidators(t *testing.T) { defer wg.Done() require.NoError(t, d.Run(ctx)) }() - // force context switch - time.Sleep(10 * time.Millisecond) + // FIXME: used to induce context switch. + // Determine more deterministic method for prompting a context switch + time.Sleep(time.Microsecond) requireConnect(t, rpcConfig.ListenAddress, 15) cli, err := httpclient.New(rpcConfig.ListenAddress) require.NoError(t, err) @@ -488,8 +495,9 @@ func TestBlockSearch(t *testing.T) { defer wg.Done() require.NoError(t, d.Run(ctx)) }() - // force context switch - time.Sleep(10 * time.Millisecond) + // FIXME: used to induce context switch. + // Determine more deterministic method for prompting a context switch + time.Sleep(time.Microsecond) requireConnect(t, rpcConfig.ListenAddress, 15) cli, err := httpclient.New(rpcConfig.ListenAddress) require.NoError(t, err) diff --git a/inspect/rpc/rpc.go b/inspect/rpc/rpc.go index e582c4487..f89c60a3e 100644 --- a/inspect/rpc/rpc.go +++ b/inspect/rpc/rpc.go @@ -27,6 +27,8 @@ type Server struct { } // Routes returns the set of routes used by the Inspect server. +// +//nolint: lll func Routes(cfg config.RPCConfig, s state.Store, bs state.BlockStore, es []indexer.EventSink, logger log.Logger) core.RoutesMap { env := &core.Environment{ Config: cfg,