diff --git a/abci/client/socket_client_test.go b/abci/client/socket_client_test.go index 2995c431c..54757eca8 100644 --- a/abci/client/socket_client_test.go +++ b/abci/client/socket_client_test.go @@ -53,7 +53,7 @@ func TestHangingAsyncCalls(t *testing.T) { // Call CheckTx reqres, err := c.CheckTxAsync(context.Background(), &types.RequestCheckTx{}) require.NoError(t, err) - // wait 20 ms for all events to travel socket, but + // wait 50 ms for all events to travel socket, but // no response yet from server time.Sleep(50 * time.Millisecond) // kill the server, so the connections break @@ -62,7 +62,6 @@ func TestHangingAsyncCalls(t *testing.T) { // wait for the response from CheckTx reqres.Wait() - fmt.Print(reqres) resp <- c.Error() }() @@ -157,9 +156,9 @@ type slowApp struct { types.BaseApplication } -func (slowApp) CheckTxAsync(_ context.Context, req types.RequestCheckTx) types.ResponseCheckTx { - time.Sleep(200 * time.Millisecond) - return types.ResponseCheckTx{} +func (slowApp) CheckTx(_ context.Context, req *types.RequestCheckTx) (*types.ResponseCheckTx, error) { + time.Sleep(time.Second) + return &types.ResponseCheckTx{}, nil } // TestCallbackInvokedWhenSetLaet ensures that the callback is invoked when diff --git a/mempool/v0/clist_mempool_test.go b/mempool/v0/clist_mempool_test.go index 069534f9e..01779348a 100644 --- a/mempool/v0/clist_mempool_test.go +++ b/mempool/v0/clist_mempool_test.go @@ -249,7 +249,6 @@ func TestMempoolUpdateDoesNotPanicWhenApplicationMissedTx(t *testing.T) { mockClient.On("SetLogger", mock.Anything) mockClient.On("Error").Return(nil).Times(4) - mockClient.On("Flush", mock.Anything).Return(nil) mockClient.On("SetResponseCallback", mock.MatchedBy(func(cb abciclient.Callback) bool { callback = cb; return true })) app := kvstore.NewInMemoryApplication() @@ -290,8 +289,6 @@ func TestMempoolUpdateDoesNotPanicWhenApplicationMissedTx(t *testing.T) { req = &abci.RequestCheckTx{Tx: txs[3]} callback(abci.ToRequestCheckTx(req), abci.ToResponseCheckTx(resp)) mockClient.AssertExpectations(t) - - mockClient.AssertExpectations(t) } func TestMempool_KeepInvalidTxsInCache(t *testing.T) {