From f80f6445a60fffc146eae16abf686ce3ae5546b0 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 26 Dec 2017 20:15:07 -0500 Subject: [PATCH] fix test --- consensus/replay_test.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/consensus/replay_test.go b/consensus/replay_test.go index fbab03d20..43c2a4699 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -107,14 +107,15 @@ func TestWALCrash(t *testing.T) { {"block with a smaller part size", func(cs *ConsensusState, ctx context.Context) { // XXX: is there a better way to change BlockPartSizeBytes? - params := cs.state.ConsensusParams - params.BlockPartSizeBytes = 512 - cs.state.ConsensusParams = params - sendTxs(cs, ctx) + cs.state.ConsensusParams.BlockPartSizeBytes = 512 + cs.state.Save() + go sendTxs(cs, ctx) }, 1}, {"many non-empty blocks", - sendTxs, + func(cs *ConsensusState, ctx context.Context) { + go sendTxs(cs, ctx) + }, 3}, } @@ -147,7 +148,7 @@ LOOP: // start sending transactions ctx, cancel := context.WithCancel(context.Background()) - go initFn(cs, ctx) + initFn(cs, ctx) // clean up WAL file from the previous iteration walFile := cs.config.WalFile()