increase integration tests timeout (#8389)

This commit is contained in:
Alex Sharov 2023-10-06 15:42:00 +07:00 committed by GitHub
parent ca271b1824
commit 87778fd0be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 31 deletions

View File

@ -152,11 +152,11 @@ test3:
## test-integration: run integration tests with a 30m timeout ## test-integration: run integration tests with a 30m timeout
test-integration: test-integration:
@cd erigon-lib && $(MAKE) test @cd erigon-lib && $(MAKE) test
$(GOTEST) --timeout 30m -tags $(BUILD_TAGS),integration $(GOTEST) --timeout 60m -tags $(BUILD_TAGS),integration
test3-integration: test3-integration:
@cd erigon-lib && $(MAKE) test @cd erigon-lib && $(MAKE) test
$(GOTEST) --timeout 30m -tags $(BUILD_TAGS),integration,e3 $(GOTEST) --timeout 60m -tags $(BUILD_TAGS),integration,e3
## lint-deps: install lint dependencies ## lint-deps: install lint dependencies
lint-deps: lint-deps:

View File

@ -24,6 +24,7 @@ import (
"github.com/holiman/uint256" "github.com/holiman/uint256"
"github.com/ledgerwatch/erigon-lib/chain" "github.com/ledgerwatch/erigon-lib/chain"
libcommon "github.com/ledgerwatch/erigon-lib/common" libcommon "github.com/ledgerwatch/erigon-lib/common"
"github.com/ledgerwatch/erigon-lib/kv"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/ledgerwatch/erigon/accounts/abi/bind" "github.com/ledgerwatch/erigon/accounts/abi/bind"
@ -98,12 +99,7 @@ func TestSelfDestructReceive(t *testing.T) {
t.Fatalf("generate blocks: %v", err) t.Fatalf("generate blocks: %v", err)
} }
tx, err := m.DB.BeginRw(context.Background()) if err := m.DB.View(context.Background(), func(tx kv.Tx) error {
if err != nil {
panic(err)
}
defer tx.Rollback()
st := state.New(m.NewStateReader(tx)) st := state.New(m.NewStateReader(tx))
if !st.Exist(address) { if !st.Exist(address) {
t.Error("expected account to exist") t.Error("expected account to exist")
@ -111,7 +107,10 @@ func TestSelfDestructReceive(t *testing.T) {
if st.Exist(contractAddress) { if st.Exist(contractAddress) {
t.Error("expected contractAddress to not exist before block 0", contractAddress.String()) t.Error("expected contractAddress to not exist before block 0", contractAddress.String())
} }
tx.Rollback() return nil
}); err != nil {
panic(err)
}
// BLOCK 1 // BLOCK 1
if err = m.InsertChain(chain.Slice(0, 1)); err != nil { if err = m.InsertChain(chain.Slice(0, 1)); err != nil {
@ -122,16 +121,12 @@ func TestSelfDestructReceive(t *testing.T) {
if err = m.InsertChain(chain.Slice(1, 2)); err != nil { if err = m.InsertChain(chain.Slice(1, 2)); err != nil {
t.Fatal(err) t.Fatal(err)
} }
tx, err = m.DB.BeginRw(context.Background())
if err != nil { if err := m.DB.View(context.Background(), func(tx kv.Tx) error {
panic(err)
}
defer tx.Rollback()
// If we got this far, the newly created blockchain (with empty trie cache) loaded trie from the database // If we got this far, the newly created blockchain (with empty trie cache) loaded trie from the database
// and that means that the state of the accounts written in the first block was correct. // and that means that the state of the accounts written in the first block was correct.
// This test checks that the storage root of the account is properly set to the root of the empty tree // This test checks that the storage root of the account is properly set to the root of the empty tree
st := state.New(m.NewStateReader(tx))
st = state.New(m.NewStateReader(tx))
if !st.Exist(address) { if !st.Exist(address) {
t.Error("expected account to exist") t.Error("expected account to exist")
} }
@ -141,5 +136,9 @@ func TestSelfDestructReceive(t *testing.T) {
if len(st.GetCode(contractAddress)) != 0 { if len(st.GetCode(contractAddress)) != 0 {
t.Error("expected empty code in contract at block 2", contractAddress.String()) t.Error("expected empty code in contract at block 2", contractAddress.String())
} }
return nil
}); err != nil {
panic(err)
}
} }