mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-21 22:56:22 +00:00
Build with go1.14
This commit is contained in:
@@ -8,7 +8,7 @@ Or [Blockchain](<https://en.wikipedia.org/wiki/Blockchain_(database)>), for shor
|
||||
|
||||
[](https://github.com/tendermint/tendermint/releases/latest)
|
||||
[](https://godoc.org/github.com/tendermint/tendermint)
|
||||
[](https://github.com/moovweb/gvm)
|
||||
[](https://github.com/moovweb/gvm)
|
||||
[](https://riot.im/app/#/room/#tendermint:matrix.org)
|
||||
[](https://github.com/tendermint/tendermint/blob/master/LICENSE)
|
||||
[](https://github.com/tendermint/tendermint)
|
||||
@@ -49,7 +49,7 @@ For examples of the kinds of bugs we're looking for, see [SECURITY.md](SECURITY.
|
||||
|
||||
| Requirement | Notes |
|
||||
| ----------- | ---------------- |
|
||||
| Go version | Go1.13 or higher |
|
||||
| Go version | Go1.14 or higher |
|
||||
|
||||
## Documentation
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ func TestByzantine(t *testing.T) {
|
||||
N := 4
|
||||
logger := consensusLogger().With("test", "byzantine")
|
||||
css, cleanup := randConsensusNet(N, "consensus_byzantine_test", newMockTickerFunc(false), newCounter)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
|
||||
// give the byzantine validator a normal ticker
|
||||
ticker := NewTimeoutTicker()
|
||||
@@ -85,7 +85,7 @@ func TestByzantine(t *testing.T) {
|
||||
sm.SaveState(css[i].blockExec.DB(), css[i].state) //for save height 1's validators info
|
||||
}
|
||||
|
||||
defer func() {
|
||||
t.Cleanup(func() {
|
||||
for _, r := range reactors {
|
||||
if rr, ok := r.(*ByzantineReactor); ok {
|
||||
rr.reactor.Switch.Stop()
|
||||
@@ -93,7 +93,7 @@ func TestByzantine(t *testing.T) {
|
||||
r.(*Reactor).Switch.Stop()
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
|
||||
p2p.MakeConnectedSwitches(config.P2P, N, func(i int, s *p2p.Switch) *p2p.Switch {
|
||||
// ignore new switch s, we already made ours
|
||||
|
||||
@@ -24,7 +24,7 @@ func assertMempool(txn txNotifier) mempl.Mempool {
|
||||
|
||||
func TestMempoolNoProgressUntilTxsAvailable(t *testing.T) {
|
||||
config := ResetConfig("consensus_mempool_txs_available_test")
|
||||
defer os.RemoveAll(config.RootDir)
|
||||
t.Cleanup(func() { os.RemoveAll(config.RootDir) })
|
||||
config.Consensus.CreateEmptyBlocks = false
|
||||
state, privVals := randGenesisState(1, false, 10)
|
||||
cs := newStateWithConfig(config, state, privVals[0], NewCounterApplication())
|
||||
@@ -43,7 +43,7 @@ func TestMempoolNoProgressUntilTxsAvailable(t *testing.T) {
|
||||
|
||||
func TestMempoolProgressAfterCreateEmptyBlocksInterval(t *testing.T) {
|
||||
config := ResetConfig("consensus_mempool_txs_available_test")
|
||||
defer os.RemoveAll(config.RootDir)
|
||||
t.Cleanup(func() { os.RemoveAll(config.RootDir) })
|
||||
config.Consensus.CreateEmptyBlocksInterval = ensureTimeout
|
||||
state, privVals := randGenesisState(1, false, 10)
|
||||
cs := newStateWithConfig(config, state, privVals[0], NewCounterApplication())
|
||||
@@ -59,7 +59,7 @@ func TestMempoolProgressAfterCreateEmptyBlocksInterval(t *testing.T) {
|
||||
|
||||
func TestMempoolProgressInHigherRound(t *testing.T) {
|
||||
config := ResetConfig("consensus_mempool_txs_available_test")
|
||||
defer os.RemoveAll(config.RootDir)
|
||||
t.Cleanup(func() { os.RemoveAll(config.RootDir) })
|
||||
config.Consensus.CreateEmptyBlocks = false
|
||||
state, privVals := randGenesisState(1, false, 10)
|
||||
cs := newStateWithConfig(config, state, privVals[0], NewCounterApplication())
|
||||
|
||||
+18
-18
@@ -96,9 +96,9 @@ func stopConsensusNet(logger log.Logger, reactors []*Reactor, eventBuses []*type
|
||||
func TestReactorBasic(t *testing.T) {
|
||||
N := 4
|
||||
css, cleanup := randConsensusNet(N, "consensus_reactor_test", newMockTickerFunc(true), newCounter)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
reactors, blocksSubs, eventBuses := startConsensusNet(t, css, N)
|
||||
defer stopConsensusNet(log.TestingLogger(), reactors, eventBuses)
|
||||
t.Cleanup(func() { stopConsensusNet(log.TestingLogger(), reactors, eventBuses) })
|
||||
// wait till everyone makes the first new block
|
||||
timeoutWaitGroup(t, N, func(j int) {
|
||||
<-blocksSubs[j].Out()
|
||||
@@ -126,7 +126,7 @@ func TestReactorWithEvidence(t *testing.T) {
|
||||
stateDB := dbm.NewMemDB() // each state needs its own db
|
||||
state, _ := sm.LoadStateFromDBOrGenesisDoc(stateDB, genDoc)
|
||||
thisConfig := ResetConfig(fmt.Sprintf("%s_%d", testName, i))
|
||||
defer os.RemoveAll(thisConfig.RootDir)
|
||||
t.Cleanup(func() { os.RemoveAll(thisConfig.RootDir) })
|
||||
ensureDir(path.Dir(thisConfig.Consensus.WalFile()), 0700) // dir for wal
|
||||
app := appFunc()
|
||||
vals := types.TM2PB.ValidatorUpdates(state.Validators)
|
||||
@@ -175,7 +175,7 @@ func TestReactorWithEvidence(t *testing.T) {
|
||||
}
|
||||
|
||||
reactors, blocksSubs, eventBuses := startConsensusNet(t, css, nValidators)
|
||||
defer stopConsensusNet(log.TestingLogger(), reactors, eventBuses)
|
||||
t.Cleanup(func() { stopConsensusNet(log.TestingLogger(), reactors, eventBuses) })
|
||||
|
||||
// wait till everyone makes the first new block with no evidence
|
||||
timeoutWaitGroup(t, nValidators, func(j int) {
|
||||
@@ -233,9 +233,9 @@ func TestReactorCreatesBlockWhenEmptyBlocksFalse(t *testing.T) {
|
||||
func(c *cfg.Config) {
|
||||
c.Consensus.CreateEmptyBlocks = false
|
||||
})
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
reactors, blocksSubs, eventBuses := startConsensusNet(t, css, N)
|
||||
defer stopConsensusNet(log.TestingLogger(), reactors, eventBuses)
|
||||
t.Cleanup(func() { stopConsensusNet(log.TestingLogger(), reactors, eventBuses) })
|
||||
|
||||
// send a tx
|
||||
if err := assertMempool(css[3].txNotifier).CheckTx([]byte{1, 2, 3}, nil, mempl.TxInfo{}); err != nil {
|
||||
@@ -251,9 +251,9 @@ func TestReactorCreatesBlockWhenEmptyBlocksFalse(t *testing.T) {
|
||||
func TestReactorReceiveDoesNotPanicIfAddPeerHasntBeenCalledYet(t *testing.T) {
|
||||
N := 1
|
||||
css, cleanup := randConsensusNet(N, "consensus_reactor_test", newMockTickerFunc(true), newCounter)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
reactors, _, eventBuses := startConsensusNet(t, css, N)
|
||||
defer stopConsensusNet(log.TestingLogger(), reactors, eventBuses)
|
||||
t.Cleanup(func() { stopConsensusNet(log.TestingLogger(), reactors, eventBuses) })
|
||||
|
||||
var (
|
||||
reactor = reactors[0]
|
||||
@@ -273,9 +273,9 @@ func TestReactorReceiveDoesNotPanicIfAddPeerHasntBeenCalledYet(t *testing.T) {
|
||||
func TestReactorReceivePanicsIfInitPeerHasntBeenCalledYet(t *testing.T) {
|
||||
N := 1
|
||||
css, cleanup := randConsensusNet(N, "consensus_reactor_test", newMockTickerFunc(true), newCounter)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
reactors, _, eventBuses := startConsensusNet(t, css, N)
|
||||
defer stopConsensusNet(log.TestingLogger(), reactors, eventBuses)
|
||||
t.Cleanup(func() { stopConsensusNet(log.TestingLogger(), reactors, eventBuses) })
|
||||
|
||||
var (
|
||||
reactor = reactors[0]
|
||||
@@ -295,9 +295,9 @@ func TestReactorReceivePanicsIfInitPeerHasntBeenCalledYet(t *testing.T) {
|
||||
func TestReactorRecordsVotesAndBlockParts(t *testing.T) {
|
||||
N := 4
|
||||
css, cleanup := randConsensusNet(N, "consensus_reactor_test", newMockTickerFunc(true), newCounter)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
reactors, blocksSubs, eventBuses := startConsensusNet(t, css, N)
|
||||
defer stopConsensusNet(log.TestingLogger(), reactors, eventBuses)
|
||||
t.Cleanup(func() { stopConsensusNet(log.TestingLogger(), reactors, eventBuses) })
|
||||
|
||||
// wait till everyone makes the first new block
|
||||
timeoutWaitGroup(t, N, func(j int) {
|
||||
@@ -324,9 +324,9 @@ func TestReactorVotingPowerChange(t *testing.T) {
|
||||
"consensus_voting_power_changes_test",
|
||||
newMockTickerFunc(true),
|
||||
newPersistentKVStore)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
reactors, blocksSubs, eventBuses := startConsensusNet(t, css, nVals)
|
||||
defer stopConsensusNet(logger, reactors, eventBuses)
|
||||
t.Cleanup(func() { stopConsensusNet(logger, reactors, eventBuses) })
|
||||
|
||||
// map of active validators
|
||||
activeVals := make(map[string]struct{})
|
||||
@@ -401,11 +401,11 @@ func TestReactorValidatorSetChanges(t *testing.T) {
|
||||
newMockTickerFunc(true),
|
||||
newPersistentKVStoreWithPath)
|
||||
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
logger := log.TestingLogger()
|
||||
|
||||
reactors, blocksSubs, eventBuses := startConsensusNet(t, css, nPeers)
|
||||
defer stopConsensusNet(logger, reactors, eventBuses)
|
||||
t.Cleanup(func() { stopConsensusNet(logger, reactors, eventBuses) })
|
||||
|
||||
// map of active validators
|
||||
activeVals := make(map[string]struct{})
|
||||
@@ -502,14 +502,14 @@ func TestReactorValidatorSetChanges(t *testing.T) {
|
||||
func TestReactorWithTimeoutCommit(t *testing.T) {
|
||||
N := 4
|
||||
css, cleanup := randConsensusNet(N, "consensus_reactor_with_timeout_commit_test", newMockTickerFunc(false), newCounter)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
// override default SkipTimeoutCommit == true for tests
|
||||
for i := 0; i < N; i++ {
|
||||
css[i].config.SkipTimeoutCommit = false
|
||||
}
|
||||
|
||||
reactors, blocksSubs, eventBuses := startConsensusNet(t, css, N-1)
|
||||
defer stopConsensusNet(log.TestingLogger(), reactors, eventBuses)
|
||||
t.Cleanup(func() { stopConsensusNet(log.TestingLogger(), reactors, eventBuses) })
|
||||
|
||||
// wait till everyone makes the first new block
|
||||
timeoutWaitGroup(t, N-1, func(j int) {
|
||||
|
||||
@@ -82,7 +82,7 @@ func startNewStateAndWaitForBlock(t *testing.T, consensusReplayConfig *cfg.Confi
|
||||
|
||||
err := cs.Start()
|
||||
require.NoError(t, err)
|
||||
defer cs.Stop()
|
||||
t.Cleanup(func() { cs.Stop() })
|
||||
|
||||
// This is just a signal that we haven't halted; its not something contained
|
||||
// in the WAL itself. Assuming the consensus state is running, replay of any
|
||||
@@ -808,7 +808,7 @@ func TestHandshakePanicsIfAppReturnsWrongAppHash(t *testing.T) {
|
||||
// - 0x02
|
||||
// - 0x03
|
||||
config := ResetConfig("handshake_test_")
|
||||
defer os.RemoveAll(config.RootDir)
|
||||
t.Cleanup(func() { os.RemoveAll(config.RootDir) })
|
||||
privVal := privval.LoadFilePV(config.PrivValidatorKeyFile(), config.PrivValidatorStateFile())
|
||||
const appVersion = 0x0
|
||||
stateDB, state, store := stateAndStore(config, privVal.GetPubKey(), appVersion)
|
||||
@@ -1093,7 +1093,7 @@ func TestHandshakeUpdatesValidators(t *testing.T) {
|
||||
clientCreator := proxy.NewLocalClientCreator(app)
|
||||
|
||||
config := ResetConfig("handshake_test_")
|
||||
defer os.RemoveAll(config.RootDir)
|
||||
t.Cleanup(func() { os.RemoveAll(config.RootDir) })
|
||||
privVal := privval.LoadFilePV(config.PrivValidatorKeyFile(), config.PrivValidatorStateFile())
|
||||
stateDB, state, store := stateAndStore(config, privVal.GetPubKey(), 0x0)
|
||||
|
||||
@@ -1106,7 +1106,7 @@ func TestHandshakeUpdatesValidators(t *testing.T) {
|
||||
if err := proxyApp.Start(); err != nil {
|
||||
t.Fatalf("Error starting proxy app connections: %v", err)
|
||||
}
|
||||
defer proxyApp.Stop()
|
||||
t.Cleanup(func() { proxyApp.Stop() })
|
||||
if err := handshaker.Handshake(proxyApp); err != nil {
|
||||
t.Fatalf("Error on abci handshake: %v", err)
|
||||
}
|
||||
|
||||
+11
-11
@@ -29,7 +29,7 @@ const (
|
||||
func TestWALTruncate(t *testing.T) {
|
||||
walDir, err := ioutil.TempDir("", "wal")
|
||||
require.NoError(t, err)
|
||||
defer os.RemoveAll(walDir)
|
||||
t.Cleanup(func() { os.RemoveAll(walDir) })
|
||||
|
||||
walFile := filepath.Join(walDir, "wal")
|
||||
|
||||
@@ -45,12 +45,12 @@ func TestWALTruncate(t *testing.T) {
|
||||
wal.SetLogger(log.TestingLogger())
|
||||
err = wal.Start()
|
||||
require.NoError(t, err)
|
||||
defer func() {
|
||||
t.Cleanup(func() {
|
||||
wal.Stop()
|
||||
// wait for the wal to finish shutting down so we
|
||||
// can safely remove the directory
|
||||
wal.Wait()
|
||||
}()
|
||||
})
|
||||
|
||||
// 60 block's size nearly 70K, greater than group's headBuf size(4096 * 10),
|
||||
// when headBuf is full, truncate content will Flush to the file. at this
|
||||
@@ -67,7 +67,7 @@ func TestWALTruncate(t *testing.T) {
|
||||
assert.NoError(t, err, "expected not to err on height %d", h)
|
||||
assert.True(t, found, "expected to find end height for %d", h)
|
||||
assert.NotNil(t, gr)
|
||||
defer gr.Close()
|
||||
t.Cleanup(func() { gr.Close() })
|
||||
|
||||
dec := NewWALDecoder(gr)
|
||||
msg, err := dec.Decode()
|
||||
@@ -107,19 +107,19 @@ func TestWALEncoderDecoder(t *testing.T) {
|
||||
func TestWALWrite(t *testing.T) {
|
||||
walDir, err := ioutil.TempDir("", "wal")
|
||||
require.NoError(t, err)
|
||||
defer os.RemoveAll(walDir)
|
||||
t.Cleanup(func() { os.RemoveAll(walDir) })
|
||||
walFile := filepath.Join(walDir, "wal")
|
||||
|
||||
wal, err := NewWAL(walFile)
|
||||
require.NoError(t, err)
|
||||
err = wal.Start()
|
||||
require.NoError(t, err)
|
||||
defer func() {
|
||||
t.Cleanup(func() {
|
||||
wal.Stop()
|
||||
// wait for the wal to finish shutting down so we
|
||||
// can safely remove the directory
|
||||
wal.Wait()
|
||||
}()
|
||||
})
|
||||
|
||||
// 1) Write returns an error if msg is too big
|
||||
msg := &BlockPartMessage{
|
||||
@@ -157,7 +157,7 @@ func TestWALSearchForEndHeight(t *testing.T) {
|
||||
assert.NoError(t, err, "expected not to err on height %d", h)
|
||||
assert.True(t, found, "expected to find end height for %d", h)
|
||||
assert.NotNil(t, gr)
|
||||
defer gr.Close()
|
||||
t.Cleanup(func() { gr.Close() })
|
||||
|
||||
dec := NewWALDecoder(gr)
|
||||
msg, err := dec.Decode()
|
||||
@@ -170,7 +170,7 @@ func TestWALSearchForEndHeight(t *testing.T) {
|
||||
func TestWALPeriodicSync(t *testing.T) {
|
||||
walDir, err := ioutil.TempDir("", "wal")
|
||||
require.NoError(t, err)
|
||||
defer os.RemoveAll(walDir)
|
||||
t.Cleanup(func() { os.RemoveAll(walDir) })
|
||||
|
||||
walFile := filepath.Join(walDir, "wal")
|
||||
wal, err := NewWAL(walFile, autofile.GroupCheckDuration(1*time.Millisecond))
|
||||
@@ -187,10 +187,10 @@ func TestWALPeriodicSync(t *testing.T) {
|
||||
assert.NotZero(t, wal.Group().Buffered())
|
||||
|
||||
require.NoError(t, wal.Start())
|
||||
defer func() {
|
||||
t.Cleanup(func() {
|
||||
wal.Stop()
|
||||
wal.Wait()
|
||||
}()
|
||||
})
|
||||
|
||||
time.Sleep(walTestFlushInterval + (10 * time.Millisecond))
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/tendermint/tendermint
|
||||
|
||||
go 1.13
|
||||
go 1.14
|
||||
|
||||
require (
|
||||
github.com/ChainSafe/go-schnorrkel v0.0.0-20200102211924-4bcbc698314f
|
||||
|
||||
@@ -17,12 +17,12 @@ import (
|
||||
func TestSIGHUP(t *testing.T) {
|
||||
origDir, err := os.Getwd()
|
||||
require.NoError(t, err)
|
||||
defer os.Chdir(origDir)
|
||||
t.Cleanup(func() { os.Chdir(origDir) })
|
||||
|
||||
// First, create a temporary directory and move into it
|
||||
dir, err := ioutil.TempDir("", "sighup_test")
|
||||
require.NoError(t, err)
|
||||
defer os.RemoveAll(dir)
|
||||
t.Cleanup(func() { os.RemoveAll(dir) })
|
||||
err = os.Chdir(dir)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -45,7 +45,7 @@ func TestSIGHUP(t *testing.T) {
|
||||
// Move into a different temporary directory
|
||||
otherDir, err := ioutil.TempDir("", "sighup_test_other")
|
||||
require.NoError(t, err)
|
||||
defer os.RemoveAll(otherDir)
|
||||
t.Cleanup(func() { os.RemoveAll(otherDir) })
|
||||
err = os.Chdir(otherDir)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
@@ -111,11 +111,11 @@ func TestRotateFile(t *testing.T) {
|
||||
// relative paths are resolved at Group creation
|
||||
origDir, err := os.Getwd()
|
||||
require.NoError(t, err)
|
||||
defer os.Chdir(origDir)
|
||||
t.Cleanup(func() { os.Chdir(origDir) })
|
||||
|
||||
dir, err := ioutil.TempDir("", "rotate_test")
|
||||
require.NoError(t, err)
|
||||
defer os.RemoveAll(dir)
|
||||
t.Cleanup(func() { os.RemoveAll(dir) })
|
||||
err = os.Chdir(dir)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ func BenchmarkReap(b *testing.B) {
|
||||
app := kvstore.NewApplication()
|
||||
cc := proxy.NewLocalClientCreator(app)
|
||||
mempool, cleanup := newMempoolWithApp(cc)
|
||||
defer cleanup()
|
||||
b.Cleanup(cleanup)
|
||||
|
||||
size := 10000
|
||||
for i := 0; i < size; i++ {
|
||||
@@ -30,7 +30,7 @@ func BenchmarkCheckTx(b *testing.B) {
|
||||
app := kvstore.NewApplication()
|
||||
cc := proxy.NewLocalClientCreator(app)
|
||||
mempool, cleanup := newMempoolWithApp(cc)
|
||||
defer cleanup()
|
||||
b.Cleanup(cleanup)
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
tx := make([]byte, 8)
|
||||
|
||||
@@ -39,7 +39,7 @@ func TestCacheAfterUpdate(t *testing.T) {
|
||||
app := kvstore.NewApplication()
|
||||
cc := proxy.NewLocalClientCreator(app)
|
||||
mempool, cleanup := newMempoolWithApp(cc)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
|
||||
// reAddIndices & txsInCache can have elements > numTxsToCreate
|
||||
// also assumes max index is 255 for convenience
|
||||
|
||||
@@ -94,7 +94,7 @@ func TestReapMaxBytesMaxGas(t *testing.T) {
|
||||
app := kvstore.NewApplication()
|
||||
cc := proxy.NewLocalClientCreator(app)
|
||||
mempool, cleanup := newMempoolWithApp(cc)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
|
||||
// Ensure gas calculation behaves as expected
|
||||
checkTxs(t, mempool, 1, UnknownPeerID)
|
||||
@@ -143,7 +143,7 @@ func TestMempoolFilters(t *testing.T) {
|
||||
app := kvstore.NewApplication()
|
||||
cc := proxy.NewLocalClientCreator(app)
|
||||
mempool, cleanup := newMempoolWithApp(cc)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
emptyTxArr := []types.Tx{[]byte{}}
|
||||
|
||||
nopPreFilter := func(tx types.Tx) error { return nil }
|
||||
@@ -182,7 +182,7 @@ func TestMempoolUpdate(t *testing.T) {
|
||||
app := kvstore.NewApplication()
|
||||
cc := proxy.NewLocalClientCreator(app)
|
||||
mempool, cleanup := newMempoolWithApp(cc)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
|
||||
// 1. Adds valid txs to the cache
|
||||
{
|
||||
@@ -217,7 +217,7 @@ func TestTxsAvailable(t *testing.T) {
|
||||
app := kvstore.NewApplication()
|
||||
cc := proxy.NewLocalClientCreator(app)
|
||||
mempool, cleanup := newMempoolWithApp(cc)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
mempool.EnableTxsAvailable()
|
||||
|
||||
timeoutMS := 500
|
||||
@@ -263,7 +263,7 @@ func TestSerialReap(t *testing.T) {
|
||||
cc := proxy.NewLocalClientCreator(app)
|
||||
|
||||
mempool, cleanup := newMempoolWithApp(cc)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
|
||||
appConnCon, _ := cc.NewABCIClient()
|
||||
appConnCon.SetLogger(log.TestingLogger().With("module", "abci-client", "connection", "consensus"))
|
||||
@@ -384,7 +384,7 @@ func TestMempoolCloseWAL(t *testing.T) {
|
||||
app := kvstore.NewApplication()
|
||||
cc := proxy.NewLocalClientCreator(app)
|
||||
mempool, cleanup := newMempoolWithAppAndConfig(cc, wcfg)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
mempool.height = 10
|
||||
mempool.InitWAL()
|
||||
|
||||
@@ -425,7 +425,7 @@ func TestMempoolMaxMsgSize(t *testing.T) {
|
||||
app := kvstore.NewApplication()
|
||||
cc := proxy.NewLocalClientCreator(app)
|
||||
mempl, cleanup := newMempoolWithApp(cc)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
|
||||
maxTxSize := mempl.config.MaxTxBytes
|
||||
maxMsgSize := calcMaxMsgSize(maxTxSize)
|
||||
@@ -478,7 +478,7 @@ func TestMempoolTxsBytes(t *testing.T) {
|
||||
config := cfg.ResetTestRoot("mempool_test")
|
||||
config.Mempool.MaxTxsBytes = 10
|
||||
mempool, cleanup := newMempoolWithAppAndConfig(cc, config)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
|
||||
// 1. zero by default
|
||||
assert.EqualValues(t, 0, mempool.TxsBytes())
|
||||
@@ -512,7 +512,7 @@ func TestMempoolTxsBytes(t *testing.T) {
|
||||
app2 := counter.NewApplication(true)
|
||||
cc = proxy.NewLocalClientCreator(app2)
|
||||
mempool, cleanup = newMempoolWithApp(cc)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
|
||||
txBytes := make([]byte, 8)
|
||||
binary.BigEndian.PutUint64(txBytes, uint64(0))
|
||||
@@ -525,7 +525,7 @@ func TestMempoolTxsBytes(t *testing.T) {
|
||||
appConnCon.SetLogger(log.TestingLogger().With("module", "abci-client", "connection", "consensus"))
|
||||
err = appConnCon.Start()
|
||||
require.Nil(t, err)
|
||||
defer appConnCon.Stop()
|
||||
t.Cleanup(func() { appConnCon.Stop() })
|
||||
res, err := appConnCon.DeliverTxSync(abci.RequestDeliverTx{Tx: txBytes})
|
||||
require.NoError(t, err)
|
||||
require.EqualValues(t, 0, res.Code)
|
||||
@@ -546,10 +546,10 @@ func TestMempoolRemoteAppConcurrency(t *testing.T) {
|
||||
sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", tmrand.Str(6))
|
||||
app := kvstore.NewApplication()
|
||||
cc, server := newRemoteApp(t, sockPath, app)
|
||||
defer server.Stop()
|
||||
t.Cleanup(func() { server.Stop() })
|
||||
config := cfg.ResetTestRoot("mempool_test")
|
||||
mempool, cleanup := newMempoolWithAppAndConfig(cc, config)
|
||||
defer cleanup()
|
||||
t.Cleanup(cleanup)
|
||||
|
||||
// generate small number of txs
|
||||
nTxs := 10
|
||||
|
||||
@@ -36,12 +36,12 @@ const oldPrivvalContent = `{
|
||||
func TestLoadAndUpgrade(t *testing.T) {
|
||||
|
||||
oldFilePath := initTmpOldFile(t)
|
||||
defer os.Remove(oldFilePath)
|
||||
t.Cleanup(func(){os.Remove(oldFilePath)})
|
||||
newStateFile, err := ioutil.TempFile("", "priv_validator_state*.json")
|
||||
defer os.Remove(newStateFile.Name())
|
||||
t.Cleanup(func(){os.Remove(newStateFile.Name())})
|
||||
require.NoError(t, err)
|
||||
newKeyFile, err := ioutil.TempFile("", "priv_validator_key*.json")
|
||||
defer os.Remove(newKeyFile.Name())
|
||||
t.Cleanup(func(){os.Remove(newKeyFile.Name())})
|
||||
require.NoError(t, err)
|
||||
|
||||
oldPV, err := privval.LoadOldFilePV(oldFilePath)
|
||||
|
||||
@@ -61,8 +61,8 @@ func TestSignerClose(t *testing.T) {
|
||||
|
||||
func TestSignerPing(t *testing.T) {
|
||||
for _, tc := range getSignerTestCases(t) {
|
||||
defer tc.signerServer.Stop()
|
||||
defer tc.signerClient.Close()
|
||||
t.Cleanup(func() { tc.signerServer.Stop() })
|
||||
t.Cleanup(func() { tc.signerClient.Close() })
|
||||
|
||||
err := tc.signerClient.Ping()
|
||||
assert.NoError(t, err)
|
||||
@@ -71,8 +71,8 @@ func TestSignerPing(t *testing.T) {
|
||||
|
||||
func TestSignerGetPubKey(t *testing.T) {
|
||||
for _, tc := range getSignerTestCases(t) {
|
||||
defer tc.signerServer.Stop()
|
||||
defer tc.signerClient.Close()
|
||||
t.Cleanup(func() { tc.signerServer.Stop() })
|
||||
t.Cleanup(func() { tc.signerClient.Close() })
|
||||
|
||||
pubKey := tc.signerClient.GetPubKey()
|
||||
expectedPubKey := tc.mockPV.GetPubKey()
|
||||
@@ -92,8 +92,8 @@ func TestSignerProposal(t *testing.T) {
|
||||
want := &types.Proposal{Timestamp: ts}
|
||||
have := &types.Proposal{Timestamp: ts}
|
||||
|
||||
defer tc.signerServer.Stop()
|
||||
defer tc.signerClient.Close()
|
||||
t.Cleanup(func() { tc.signerServer.Stop() })
|
||||
t.Cleanup(func() { tc.signerClient.Close() })
|
||||
|
||||
require.NoError(t, tc.mockPV.SignProposal(tc.chainID, want))
|
||||
require.NoError(t, tc.signerClient.SignProposal(tc.chainID, have))
|
||||
@@ -108,8 +108,8 @@ func TestSignerVote(t *testing.T) {
|
||||
want := &types.Vote{Timestamp: ts, Type: types.PrecommitType}
|
||||
have := &types.Vote{Timestamp: ts, Type: types.PrecommitType}
|
||||
|
||||
defer tc.signerServer.Stop()
|
||||
defer tc.signerClient.Close()
|
||||
t.Cleanup(func() { tc.signerServer.Stop() })
|
||||
t.Cleanup(func() { tc.signerClient.Close() })
|
||||
|
||||
require.NoError(t, tc.mockPV.SignVote(tc.chainID, want))
|
||||
require.NoError(t, tc.signerClient.SignVote(tc.chainID, have))
|
||||
@@ -124,8 +124,8 @@ func TestSignerVoteResetDeadline(t *testing.T) {
|
||||
want := &types.Vote{Timestamp: ts, Type: types.PrecommitType}
|
||||
have := &types.Vote{Timestamp: ts, Type: types.PrecommitType}
|
||||
|
||||
defer tc.signerServer.Stop()
|
||||
defer tc.signerClient.Close()
|
||||
t.Cleanup(func() { tc.signerServer.Stop() })
|
||||
t.Cleanup(func() { tc.signerClient.Close() })
|
||||
|
||||
time.Sleep(testTimeoutReadWrite2o3)
|
||||
|
||||
@@ -150,8 +150,8 @@ func TestSignerVoteKeepAlive(t *testing.T) {
|
||||
want := &types.Vote{Timestamp: ts, Type: types.PrecommitType}
|
||||
have := &types.Vote{Timestamp: ts, Type: types.PrecommitType}
|
||||
|
||||
defer tc.signerServer.Stop()
|
||||
defer tc.signerClient.Close()
|
||||
t.Cleanup(func() { tc.signerServer.Stop() })
|
||||
t.Cleanup(func() { tc.signerClient.Close() })
|
||||
|
||||
// Check that even if the client does not request a
|
||||
// signature for a long time. The service is still available
|
||||
@@ -175,8 +175,8 @@ func TestSignerSignProposalErrors(t *testing.T) {
|
||||
tc.signerServer.privVal = types.NewErroringMockPV()
|
||||
tc.mockPV = types.NewErroringMockPV()
|
||||
|
||||
defer tc.signerServer.Stop()
|
||||
defer tc.signerClient.Close()
|
||||
t.Cleanup(func() { tc.signerServer.Stop() })
|
||||
t.Cleanup(func() { tc.signerClient.Close() })
|
||||
|
||||
ts := time.Now()
|
||||
proposal := &types.Proposal{Timestamp: ts}
|
||||
@@ -200,8 +200,8 @@ func TestSignerSignVoteErrors(t *testing.T) {
|
||||
tc.signerServer.privVal = types.NewErroringMockPV()
|
||||
tc.mockPV = types.NewErroringMockPV()
|
||||
|
||||
defer tc.signerServer.Stop()
|
||||
defer tc.signerClient.Close()
|
||||
t.Cleanup(func() { tc.signerServer.Stop() })
|
||||
t.Cleanup(func() { tc.signerClient.Close() })
|
||||
|
||||
err := tc.signerClient.SignVote(tc.chainID, vote)
|
||||
require.Equal(t, err.(*RemoteSignerError).Description, types.ErroringMockPVErr.Error())
|
||||
@@ -245,8 +245,8 @@ func TestSignerUnexpectedResponse(t *testing.T) {
|
||||
|
||||
tc.signerServer.SetRequestHandler(brokenHandler)
|
||||
|
||||
defer tc.signerServer.Stop()
|
||||
defer tc.signerClient.Close()
|
||||
t.Cleanup(func() { tc.signerServer.Stop() })
|
||||
t.Cleanup(func() { tc.signerClient.Close() })
|
||||
|
||||
ts := time.Now()
|
||||
want := &types.Vote{Timestamp: ts, Type: types.PrecommitType}
|
||||
|
||||
@@ -73,7 +73,7 @@ func TestSignerRemoteRetryTCPOnly(t *testing.T) {
|
||||
|
||||
err = signerServer.Start()
|
||||
require.NoError(t, err)
|
||||
defer signerServer.Stop()
|
||||
t.Cleanup(func() { signerServer.Stop() })
|
||||
|
||||
select {
|
||||
case attempts := <-attemptCh:
|
||||
@@ -104,7 +104,7 @@ func TestRetryConnToRemoteSigner(t *testing.T) {
|
||||
signerServer := NewSignerServer(dialerEndpoint, chainID, mockPV)
|
||||
|
||||
startListenerEndpointAsync(t, listenerEndpoint, endpointIsOpenCh)
|
||||
defer listenerEndpoint.Stop()
|
||||
t.Cleanup(func() { listenerEndpoint.Stop() })
|
||||
|
||||
require.NoError(t, signerServer.Start())
|
||||
assert.True(t, signerServer.IsRunning())
|
||||
@@ -120,7 +120,7 @@ func TestRetryConnToRemoteSigner(t *testing.T) {
|
||||
// let some pings pass
|
||||
require.NoError(t, signerServer2.Start())
|
||||
assert.True(t, signerServer2.IsRunning())
|
||||
defer signerServer2.Stop()
|
||||
t.Cleanup(func() { signerServer2.Stop() })
|
||||
|
||||
// give the client some time to re-establish the conn to the remote signer
|
||||
// should see sth like this in the logs:
|
||||
|
||||
@@ -55,7 +55,7 @@ func TestEcho(t *testing.T) {
|
||||
if err := s.Start(); err != nil {
|
||||
t.Fatalf("Error starting socket server: %v", err.Error())
|
||||
}
|
||||
defer s.Stop()
|
||||
t.Cleanup(func() { s.Stop() })
|
||||
|
||||
// Start client
|
||||
cli, err := clientCreator.NewABCIClient()
|
||||
@@ -89,7 +89,7 @@ func BenchmarkEcho(b *testing.B) {
|
||||
if err := s.Start(); err != nil {
|
||||
b.Fatalf("Error starting socket server: %v", err.Error())
|
||||
}
|
||||
defer s.Stop()
|
||||
b.Cleanup(func() { s.Stop() })
|
||||
|
||||
// Start client
|
||||
cli, err := clientCreator.NewABCIClient()
|
||||
@@ -128,7 +128,7 @@ func TestInfo(t *testing.T) {
|
||||
if err := s.Start(); err != nil {
|
||||
t.Fatalf("Error starting socket server: %v", err.Error())
|
||||
}
|
||||
defer s.Stop()
|
||||
t.Cleanup(func() { s.Stop() })
|
||||
|
||||
// Start client
|
||||
cli, err := clientCreator.NewABCIClient()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
GITIAN_CACHE_DIRNAME='.gitian-builder-cache'
|
||||
GO_RELEASE='1.13.3'
|
||||
GO_RELEASE='1.14'
|
||||
GO_TARBALL="go${GO_RELEASE}.linux-amd64.tar.gz"
|
||||
GO_TARBALL_URL="https://dl.google.com/go/${GO_TARBALL}"
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ remotes:
|
||||
- "url": "https://github.com/tendermint/tendermint.git"
|
||||
"dir": "tendermint"
|
||||
files:
|
||||
- "go1.13.3.linux-amd64.tar.gz"
|
||||
- "go1.14.linux-amd64.tar.gz"
|
||||
script: |
|
||||
set -e -o pipefail
|
||||
|
||||
GO_SRC_RELEASE=go1.13.3.linux-amd64
|
||||
GO_SRC_RELEASE=go1.14.linux-amd64
|
||||
GO_SRC_TARBALL="${GO_SRC_RELEASE}.tar.gz"
|
||||
# Compile go and configure the environment
|
||||
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
|
||||
|
||||
@@ -23,11 +23,11 @@ remotes:
|
||||
- "url": "https://github.com/tendermint/tendermint.git"
|
||||
"dir": "tendermint"
|
||||
files:
|
||||
- "go1.13.3.linux-amd64.tar.gz"
|
||||
- "go1.14.linux-amd64.tar.gz"
|
||||
script: |
|
||||
set -e -o pipefail
|
||||
|
||||
GO_SRC_RELEASE=go1.13.3.linux-amd64
|
||||
GO_SRC_RELEASE=go1.14.linux-amd64
|
||||
GO_SRC_TARBALL="${GO_SRC_RELEASE}.tar.gz"
|
||||
# Compile go and configure the environment
|
||||
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
|
||||
|
||||
@@ -23,11 +23,11 @@ remotes:
|
||||
- "url": "https://github.com/tendermint/tendermint.git"
|
||||
"dir": "tendermint"
|
||||
files:
|
||||
- "go1.13.3.linux-amd64.tar.gz"
|
||||
- "go1.14.linux-amd64.tar.gz"
|
||||
script: |
|
||||
set -e -o pipefail
|
||||
|
||||
GO_SRC_RELEASE=go1.13.3.linux-amd64
|
||||
GO_SRC_RELEASE=go1.14.linux-amd64
|
||||
GO_SRC_TARBALL="${GO_SRC_RELEASE}.tar.gz"
|
||||
# Compile go and configure the environment
|
||||
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.13
|
||||
FROM golang:1.14
|
||||
|
||||
# Add testing deps for curl
|
||||
RUN echo 'deb http://httpredir.debian.org/debian testing main non-free contrib' >> /etc/apt/sources.list
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
requirements_check = true
|
||||
gpg_check = false
|
||||
go_min_version = 1.13
|
||||
go_min_version = 1.14
|
||||
gpg_key = 2122CBE9
|
||||
|
||||
ifeq ($(requirements_check),true)
|
||||
|
||||
Reference in New Issue
Block a user