Skip to content

Commit

Permalink
Reduce dirty space (#12651)
Browse files Browse the repository at this point in the history
reduced ubuntu integration test time by 2 min but macOS integration time
increased significantly
  • Loading branch information
dvovk authored Nov 7, 2024
1 parent 5bdb221 commit 718d97b
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: sudo apt update && sudo apt install build-essential

- name: test-integration
run: make test-integration
run: GOGC=80 make test-integration

tests-windows:
strategy:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ GO_FLAGS += -ldflags "-X ${PACKAGE}/params.GitCommit=${GIT_COMMIT} -X ${PACKAGE}

GOBUILD = ${CPU_ARCH} CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPRIVATE="$(GOPRIVATE)" $(GO) build $(GO_FLAGS)
GO_DBG_BUILD = ${CPU_ARCH} CGO_CFLAGS="$(CGO_CFLAGS) -DMDBX_DEBUG=1" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPRIVATE="$(GOPRIVATE)" $(GO) build -tags $(BUILD_TAGS),debug -gcflags=all="-N -l" # see delve docs
GOTEST = ${CPU_ARCH} CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPRIVATE="$(GOPRIVATE)" GODEBUG=cgocheck=0 GOTRACEBACK=1 $(GO) test $(GO_FLAGS) ./... -p 2
GOTEST = ${CPU_ARCH} CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPRIVATE="$(GOPRIVATE)" GODEBUG=cgocheck=0 GOTRACEBACK=1 $(GO) test $(GO_FLAGS) ./...

default: all

Expand Down
2 changes: 1 addition & 1 deletion erigon-lib/kv/mdbx/kv_mdbx.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (opts MdbxOpts) InMem(tmpDir string) MdbxOpts {
opts.flags = mdbx.UtterlyNoSync | mdbx.NoMetaSync | mdbx.NoMemInit
opts.growthStep = 2 * datasize.MB
opts.mapSize = 512 * datasize.MB
opts.dirtySpace = uint64(128 * datasize.MB)
opts.dirtySpace = uint64(64 * datasize.MB)
opts.shrinkThreshold = 0 // disable
opts.label = kv.InMem
return opts
Expand Down
1 change: 0 additions & 1 deletion erigon-lib/kv/memdb/memory_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func NewSentryDB(tmpDir string) kv.RwDB {
func NewTestDB(tb testing.TB) kv.RwDB {
tb.Helper()
tmpDir := tb.TempDir()
tb.Helper()
db := New(tmpDir)
tb.Cleanup(db.Close)
return db
Expand Down
1 change: 1 addition & 0 deletions tests/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func TestBlockchain(t *testing.T) {
checkStateRoot := true

bt.walk(t, blockTestDir, func(t *testing.T, name string, test *BlockTest) {
t.Parallel()
// import pre accounts & construct test genesis block & state root
if err := bt.checkFailure(t, test.Run(t, checkStateRoot)); err != nil {
t.Error(err)
Expand Down
1 change: 1 addition & 0 deletions tests/block_test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func (bt *BlockTest) Run(t *testing.T, checkStateRoot bool) error {
if !ok {
return UnsupportedForkError{bt.json.Network}
}

engine := ethconsensusconfig.CreateConsensusEngineBareBones(context.Background(), config, log.New())
m := mock.MockWithGenesisEngine(t, bt.genesis(config), engine, false, checkStateRoot)
defer m.Close()
Expand Down
1 change: 1 addition & 0 deletions tests/exec_spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func TestExecutionSpec(t *testing.T) {
checkStateRoot := true

bt.walk(t, dir, func(t *testing.T, name string, test *BlockTest) {
t.Parallel()
// import pre accounts & construct test genesis block & state root
if err := bt.checkFailure(t, test.Run(t, checkStateRoot)); err != nil {
t.Error(err)
Expand Down
2 changes: 1 addition & 1 deletion tests/testdata
Submodule testdata updated 105 files
1 change: 1 addition & 0 deletions turbo/stages/mock/mock_sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ func MockWithEverything(tb testing.TB, gspec *types.Genesis, key *ecdsa.PrivateK
if err = mock.InsertChain(c); err != nil {
tb.Fatal(err)
}

return mock
}

Expand Down

0 comments on commit 718d97b

Please sign in to comment.