mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-03 18:42:14 +00:00
* Rebased and git-squashed the commits in PR #6546 migrate abci to finalizeBlock work on abci, proxy and mempool abciresponse, blok events, indexer, some tests fix some tests fix errors fix errors in abci fix tests amd errors * Fixes after rebasing PR#6546 * Restored height to RequestFinalizeBlock & other * Fixed more UTs * Fixed kvstore * More UT fixes * last TC fixed * make format * Update internal/consensus/mempool_test.go Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> * Addressed @williambanfield's comments * Fixed UTs * Addressed last comments from @williambanfield * make format Co-authored-by: marbar3778 <marbar3778@yahoo.com> Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
51 lines
1.4 KiB
Go
51 lines
1.4 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"math/rand"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
e2e "github.com/tendermint/tendermint/test/e2e/pkg"
|
|
)
|
|
|
|
func TestGenerator(t *testing.T) {
|
|
manifests, err := Generate(rand.New(rand.NewSource(randomSeed)), Options{})
|
|
require.NoError(t, err)
|
|
require.True(t, len(manifests) >= 24, "insufficient combinations %d", len(manifests))
|
|
|
|
// this just means that the numbers reported by the test
|
|
// failures map to the test cases that you'd see locally.
|
|
e2e.SortManifests(manifests, false /* ascending */)
|
|
|
|
for idx, m := range manifests {
|
|
t.Run(fmt.Sprintf("Case%04d", idx), func(t *testing.T) {
|
|
numStateSyncs := 0
|
|
for name, node := range m.Nodes {
|
|
if node.StateSync != e2e.StateSyncDisabled {
|
|
numStateSyncs++
|
|
}
|
|
t.Run(name, func(t *testing.T) {
|
|
t.Run("StateSync", func(t *testing.T) {
|
|
if node.StartAt > m.InitialHeight+5 && !node.Stateless() {
|
|
require.NotEqual(t, node.StateSync, e2e.StateSyncDisabled)
|
|
}
|
|
if node.StateSync != e2e.StateSyncDisabled {
|
|
require.Zero(t, node.Seeds, node.StateSync)
|
|
require.True(t, len(node.PersistentPeers) >= 2 || len(node.PersistentPeers) == 0,
|
|
"peers: %v", node.PersistentPeers)
|
|
}
|
|
})
|
|
if e2e.Mode(node.Mode) != e2e.ModeLight {
|
|
t.Run("PrivvalProtocol", func(t *testing.T) {
|
|
require.NotZero(t, node.PrivvalProtocol)
|
|
})
|
|
}
|
|
})
|
|
}
|
|
require.True(t, numStateSyncs <= 2)
|
|
})
|
|
}
|
|
}
|