Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions db/db_pebble_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ package db

import (
"context"
"os"
"testing"

"github.com/pkg/errors"
"github.com/stretchr/testify/require"

"github.com/iotexproject/iotex-core/v2/db/batch"
"github.com/iotexproject/iotex-core/v2/testutil"
)

type kvTest struct {
Expand All @@ -24,11 +22,7 @@ type kvTest struct {

func TestPebbleDB(t *testing.T) {
r := require.New(t)
testPath, err := os.MkdirTemp("", "test-pebble")
r.NoError(err)
defer func() {
testutil.CleanupPath(testPath)
}()
testPath := t.TempDir()

cfg := DefaultConfig
cfg.DbPath = testPath
Expand Down Expand Up @@ -131,11 +125,7 @@ func TestPebbleDB(t *testing.T) {

func TestPebbleDB_Filter(t *testing.T) {
r := require.New(t)
testPath, err := os.MkdirTemp("", "test-pebble")
r.NoError(err)
defer func() {
testutil.CleanupPath(testPath)
}()
testPath := t.TempDir()

cfg := DefaultConfig
cfg.DbPath = testPath
Expand Down Expand Up @@ -189,11 +179,7 @@ func TestPebbleDB_Filter(t *testing.T) {

func TestPebbleDB_Foreach(t *testing.T) {
r := require.New(t)
testPath, err := os.MkdirTemp("", "test-pebble")
r.NoError(err)
defer func() {
testutil.CleanupPath(testPath)
}()
testPath := t.TempDir()

cfg := DefaultConfig
cfg.DbPath = testPath
Expand Down
4 changes: 1 addition & 3 deletions server/itx/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package itx

import (
"context"
"os"
"testing"
"time"

Expand Down Expand Up @@ -83,8 +82,7 @@ func newConfig(t *testing.T) (config.Config, func()) {
require.NoError(err)
contractIndexPath, err := testutil.PathOfTempFile("contractindxer.db")
require.NoError(err)
testActionStorePath, err := os.MkdirTemp(os.TempDir(), "actionstore")
require.NoError(err)
testActionStorePath := t.TempDir()
cfg := config.Default
cfg.API.GRPCPort = testutil.RandomPort()
cfg.API.HTTPPort = testutil.RandomPort()
Expand Down