From 5f55ed2a40dcdc38b1682c96875558005cdaf56b Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 13 Sep 2016 16:50:13 -0400 Subject: [PATCH] consensus: ensure dir for cswal on reactor tests --- consensus/common_test.go | 6 ++++++ consensus/reactor_test.go | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/consensus/common_test.go b/consensus/common_test.go index 3a509ff3d..e6bba8e6e 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -8,6 +8,7 @@ import ( "testing" "time" + . "github.com/tendermint/go-common" cfg "github.com/tendermint/go-config" dbm "github.com/tendermint/go-db" bc "github.com/tendermint/tendermint/blockchain" @@ -255,6 +256,11 @@ func randConsensusNet(nValidators int) []*ConsensusState { state.Save() css[i] = newConsensusState(state, privVals[i], counter.NewCounterApplication(true)) } + + // we use memdb, but need a dir for the cswal. + // in this case they all write to the same one but we dont care + // NOTE: they all share a pointer to the same config object! + EnsureDir(css[0].config.GetString("db_dir"), 0700) return css } diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index 378d4bd85..b5fbe44bf 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -35,7 +35,7 @@ func resetConfigTimeouts() { // config.Set("timeout_commit", 1000) } -func _TestReactor(t *testing.T) { +func TestReactor(t *testing.T) { resetConfigTimeouts() N := 4 css := randConsensusNet(N) @@ -85,7 +85,7 @@ func _TestReactor(t *testing.T) { } } -func _TestByzantine(t *testing.T) { +func TestByzantine(t *testing.T) { resetConfigTimeouts() N := 4 css := randConsensusNet(N)