mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
TestState: share db (#8576)
This commit is contained in:
parent
656c3d239e
commit
7aa79a5bbb
@ -28,9 +28,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon-lib/common/datadir"
|
"github.com/ledgerwatch/erigon-lib/common/datadir"
|
||||||
|
"github.com/ledgerwatch/erigon/core/state/temporal"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon/core/state/temporal"
|
|
||||||
"github.com/ledgerwatch/erigon/core/vm"
|
"github.com/ledgerwatch/erigon/core/vm"
|
||||||
"github.com/ledgerwatch/erigon/eth/tracers/logger"
|
"github.com/ledgerwatch/erigon/eth/tracers/logger"
|
||||||
)
|
)
|
||||||
@ -38,7 +38,7 @@ import (
|
|||||||
func TestState(t *testing.T) {
|
func TestState(t *testing.T) {
|
||||||
defer log.Root().SetHandler(log.Root().GetHandler())
|
defer log.Root().SetHandler(log.Root().GetHandler())
|
||||||
log.Root().SetHandler(log.LvlFilterHandler(log.LvlError, log.StderrHandler))
|
log.Root().SetHandler(log.LvlFilterHandler(log.LvlError, log.StderrHandler))
|
||||||
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
|
if runtime.GOOS == "windows" {
|
||||||
t.Skip("fix me on win please") // it's too slow on win and stops on macos, need generally improve speed of this tests
|
t.Skip("fix me on win please") // it's too slow on win and stops on macos, need generally improve speed of this tests
|
||||||
}
|
}
|
||||||
//t.Parallel()
|
//t.Parallel()
|
||||||
@ -49,12 +49,12 @@ func TestState(t *testing.T) {
|
|||||||
st.skipLoad(`^stTimeConsuming/`)
|
st.skipLoad(`^stTimeConsuming/`)
|
||||||
st.skipLoad(`.*vmPerformance/loop.*`)
|
st.skipLoad(`.*vmPerformance/loop.*`)
|
||||||
|
|
||||||
|
_, db, _ := temporal.NewTestDB(t, datadir.New(t.TempDir()), nil)
|
||||||
st.walk(t, stateTestDir, func(t *testing.T, name string, test *StateTest) {
|
st.walk(t, stateTestDir, func(t *testing.T, name string, test *StateTest) {
|
||||||
for _, subtest := range test.Subtests() {
|
for _, subtest := range test.Subtests() {
|
||||||
subtest := subtest
|
subtest := subtest
|
||||||
key := fmt.Sprintf("%s/%d", subtest.Fork, subtest.Index)
|
key := fmt.Sprintf("%s/%d", subtest.Fork, subtest.Index)
|
||||||
t.Run(key, func(t *testing.T) {
|
t.Run(key, func(t *testing.T) {
|
||||||
_, db, _ := temporal.NewTestDB(t, datadir.New(t.TempDir()), nil)
|
|
||||||
withTrace(t, func(vmconfig vm.Config) error {
|
withTrace(t, func(vmconfig vm.Config) error {
|
||||||
tx, err := db.BeginRw(context.Background())
|
tx, err := db.BeginRw(context.Background())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user