diff --git a/abci/example/example_test.go b/abci/example/example_test.go index 8fa3ae02..677a2a48 100644 --- a/abci/example/example_test.go +++ b/abci/example/example_test.go @@ -39,7 +39,7 @@ func TestGRPC(t *testing.T) { } func testStream(t *testing.T, app types.Application) { - numDeliverTxs := 200000 + numDeliverTxs := 20000 // Start the listener server := abciserver.NewSocketServer("unix://test.sock", app) @@ -72,7 +72,7 @@ func testStream(t *testing.T, app types.Application) { } if counter == numDeliverTxs { go func() { - time.Sleep(time.Second * 2) // Wait for a bit to allow counter overflow + time.Sleep(time.Second * 1) // Wait for a bit to allow counter overflow close(done) }() return @@ -148,7 +148,7 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { t.Log("response", counter) if counter == numDeliverTxs { go func() { - time.Sleep(time.Second * 2) // Wait for a bit to allow counter overflow + time.Sleep(time.Second * 1) // Wait for a bit to allow counter overflow }() } diff --git a/libs/clist/clist_test.go b/libs/clist/clist_test.go index dbdf2f02..f6653d22 100644 --- a/libs/clist/clist_test.go +++ b/libs/clist/clist_test.go @@ -149,8 +149,8 @@ func _TestGCRandom(t *testing.T) { func TestScanRightDeleteRandom(t *testing.T) { - const numElements = 10000 - const numTimes = 1000 + const numElements = 1000 + const numTimes = 100 const numScanners = 10 l := New() @@ -209,7 +209,7 @@ func TestScanRightDeleteRandom(t *testing.T) { // Stop scanners close(stop) - time.Sleep(time.Second * 1) + // time.Sleep(time.Second * 1) // And remove all the elements. for el := l.Front(); el != nil; el = el.Next() { @@ -244,7 +244,7 @@ func TestWaitChan(t *testing.T) { for i := 1; i < 100; i++ { l.PushBack(i) pushed++ - time.Sleep(time.Duration(cmn.RandIntn(100)) * time.Millisecond) + time.Sleep(time.Duration(cmn.RandIntn(25)) * time.Millisecond) } close(done) }() @@ -283,7 +283,7 @@ FOR_LOOP2: if prev == nil { t.Fatal("expected PrevWaitChan to block forever on nil when reached first elem") } - case <-time.After(5 * time.Second): + case <-time.After(3 * time.Second): break FOR_LOOP2 } } diff --git a/p2p/conn/connection_test.go b/p2p/conn/connection_test.go index 19e05fbc..95b5488a 100644 --- a/p2p/conn/connection_test.go +++ b/p2p/conn/connection_test.go @@ -433,7 +433,6 @@ func TestMConnectionReadErrorLongMessage(t *testing.T) { _, err = client.Write(buf.Bytes()) assert.Nil(t, err) assert.True(t, expectSend(chOnRcv), "msg just right") - assert.False(t, expectSend(chOnErr), "msg just right") // send msg thats too long buf = new(bytes.Buffer) @@ -446,7 +445,6 @@ func TestMConnectionReadErrorLongMessage(t *testing.T) { assert.Nil(t, err) _, err = client.Write(buf.Bytes()) assert.NotNil(t, err) - assert.False(t, expectSend(chOnRcv), "msg too long") assert.True(t, expectSend(chOnErr), "msg too long") }