mirror of
https://github.com/tendermint/tendermint.git
synced 2026-04-23 17:20:33 +00:00
add sleep for test context switch
This commit is contained in:
@@ -3,7 +3,6 @@ package inspect
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
@@ -104,7 +103,6 @@ func (inspect *Inspect) Run(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
fmt.Println("stopping indexer")
|
||||
err := inspect.indexerService.Stop()
|
||||
if err != nil {
|
||||
inspect.logger.Error("indexer stopped with error", "err", err)
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/fortytw2/leaktest"
|
||||
"github.com/stretchr/testify/mock"
|
||||
@@ -81,6 +82,8 @@ func TestInspectServeInfoRPC(t *testing.T) {
|
||||
defer wg.Done()
|
||||
require.NoError(t, d.Run(ctx))
|
||||
}()
|
||||
// force context switch
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
requireConnect(t, rpcConfig.ListenAddress, 15)
|
||||
cli, err := http_client.New(rpcConfig.ListenAddress)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user