Skip to content

Commit

Permalink
[badger]: use (TB).TempDir instead of non-portable /mnt/* (#3325)
Browse files Browse the repository at this point in the history
Previously the Benchmark code ALWAYS assumed that "/mnt/ssd/" would
exist, yet when there is no permission or on read only systems,
using it would fail. This change instead uses the benchmarks'
temporary directory as the base for operations.

Fixes #3301

Signed-off-by: Emmanuel T Odeke <[email protected]>

Co-authored-by: Emmanuel T Odeke <[email protected]>
  • Loading branch information
pavolloffay and odeke-em authored Oct 14, 2021
1 parent 0d1727c commit 51ce980
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugin/storage/badger/spanstore/read_write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"log"
"math/rand"
"os"
"path/filepath"
"runtime/pprof"
"testing"
"time"
Expand Down Expand Up @@ -614,7 +615,7 @@ func runLargeFactoryTest(tb testing.TB, test func(tb testing.TB, sw spanstore.Wr
opts := badger.NewOptions("badger")
v, command := config.Viperize(opts.AddFlags)

dir := "/mnt/ssd/badger/testRun"
dir := filepath.Join(tb.TempDir(), "badger-testRun")
err := os.MkdirAll(dir, 0700)
assert.NoError(err)
keyParam := fmt.Sprintf("--badger.directory-key=%s", dir)
Expand Down

0 comments on commit 51ce980

Please sign in to comment.