Skip to content

Commit

Permalink
Reduce number of test iterations in merkledb (ava-labs#1568)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Laine authored Jun 1, 2023
1 parent 277d223 commit 6cff7b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion x/merkledb/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ func Test_MerkleDB_RandomCases_InitialValues(t *testing.T) {
require := require.New(t)

r := rand.New(rand.NewSource(int64(0))) // #nosec G404
runRandDBTest(require, r, generateInitialValues(require, r, 2000, 3500, 0.0))
runRandDBTest(require, r, generateInitialValues(require, r, 1000, 2500, 0.0))
}

// randTest performs random trie operations.
Expand Down
2 changes: 1 addition & 1 deletion x/merkledb/history_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func Test_History_Large(t *testing.T) {
require.NoError(err)
roots := []ids.ID{}
// make sure they stay in sync
for x := 0; x < 500; x++ {
for x := 0; x < 250; x++ {
addkey := make([]byte, r.Intn(50))
_, err := r.Read(addkey)
require.NoError(err)
Expand Down
4 changes: 2 additions & 2 deletions x/merkledb/trie_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ func TestTrieViewInvalidChildrenExcept(t *testing.T) {
}

func Test_Trie_CommitToParentView_Concurrent(t *testing.T) {
for i := 0; i < 5000; i++ {
for i := 0; i < 1000; i++ {
dbTrie, err := getBasicDB()
require.NoError(t, err)
require.NotNil(t, dbTrie)
Expand Down Expand Up @@ -1163,7 +1163,7 @@ func Test_Trie_CommitToParentView_Concurrent(t *testing.T) {
}

func Test_Trie_CommitToParentDB_Concurrent(t *testing.T) {
for i := 0; i < 5000; i++ {
for i := 0; i < 1000; i++ {
dbTrie, err := getBasicDB()
require.NoError(t, err)
require.NotNil(t, dbTrie)
Expand Down

0 comments on commit 6cff7b6

Please sign in to comment.