badger-bench
badger-bench copied to clipboard
Cannot run some of testcase
Hi. My environment is macOS 10.13.4,when I try to run BenchmarkSet, it panic like this:
~/work/src/github.com/dgraph-io/badger-bench(master) » go test -run BenchmarkSet -v -bench .
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x108 pc=0x138e86e]
goroutine 96 [running]:
github.com/dgraph-io/badger.(*DB).View(0x0, 0xc420312728, 0x0, 0x0)
/Users/*/work/src/github.com/dgraph-io/badger/transaction.go:526 +0x2e
github.com/dgraph-io/badger-bench.BenchmarkReadRandomBadger.func2(0xc4200ce0a0, 0xc4201122c0)
/Users/*/work/src/github.com/dgraph-io/badger-bench/bench_test.go:133 +0x5d
github.com/dgraph-io/badger-bench.runRandomReadBenchmark.func1.1(0xc4201122c0)
/Users/*/work/src/github.com/dgraph-io/badger-bench/bench_test.go:106 +0x65
testing.(*B).RunParallel.func1(0xc4202a6220, 0xc4202a6208, 0xc4202a6200, 0xc420307800, 0xc4200ae100)
/usr/local/Cellar/go/1.10.1/libexec/src/testing/benchmark.go:623 +0x98
created by testing.(*B).RunParallel
/usr/local/Cellar/go/1.10.1/libexec/src/testing/benchmark.go:616 +0x199
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x108 pc=0x138e86e]
goroutine 181 [running]:
github.com/dgraph-io/badger.(*DB).View(0x0, 0xc420317f28, 0x0, 0x0)
/Users/*/work/src/github.com/dgraph-io/badger/transaction.go:526 +0x2e
github.com/dgraph-io/badger-bench.BenchmarkReadRandomBadger.func2(0xc420360000, 0xc42035e000)
/Users/*/work/src/github.com/dgraph-io/badger-bench/bench_test.go:133 +0x5d
github.com/dgraph-io/badger-bench.runRandomReadBenchmark.func1.1(0xc42035e000)
/Users/*/work/src/github.com/dgraph-io/badger-bench/bench_test.go:106 +0x65
testing.(*B).RunParallel.func1(0xc4202a6220, 0xc4202a6208, 0xc4202a6200, 0xc420307800, 0xc4200ae100)
/usr/local/Cellar/go/1.10.1/libexec/src/testing/benchmark.go:623 +0x98
created by testing.(*B).RunParallel
/usr/local/Cellar/go/1.10.1/libexec/src/testing/benchmark.go:616 +0x199
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x108 pc=0x138e86e]
goroutine 179 [running]:
github.com/dgraph-io/badger.(*DB).View(0x0, 0xc420313f28, 0x0, 0x0)
/Users/*/work/src/github.com/dgraph-io/badger/transaction.go:526 +0x2e
github.com/dgraph-io/badger-bench.BenchmarkReadRandomBadger.func2(0xc420350000, 0xc42034e000)
/Users/*/work/src/github.com/dgraph-io/badger-bench/bench_test.go:133 +0x5d
github.com/dgraph-io/badger-bench.runRandomReadBenchmark.func1.1(0xc42034e000)
/Users/*/work/src/github.com/dgraph-io/badger-bench/bench_test.go:106 +0x65
testing.(*B).RunParallel.func1(0xc4202a6220, 0xc4202a6208, 0xc4202a6200, 0xc420307800, 0xc4200ae100)
/usr/local/Cellar/go/1.10.1/libexec/src/testing/benchmark.go:623 +0x98
created by testing.(*B).RunParallel
/usr/local/Cellar/go/1.10.1/libexec/src/testing/benchmark.go:616 +0x199
exit status 2
FAIL github.com/dgraph-io/badger-bench 0.050s
And then I go to the path store and run test, it's OK:
~/work/src/github.com/dgraph-io/badger-bench(master) » cd store
~/work/src/github.com/dgraph-io/badger-bench/store(master) » go test -run BenchmarkSet -v -bench .
goos: darwin
goarch: amd64
pkg: github.com/dgraph-io/badger-bench/store
BenchmarkGet_valsize1024-4 1000000 1936 ns/op
BenchmarkGet_valsize10KB-4 200000 9382 ns/op
BenchmarkGet_valsize500KB-4 3000 418773 ns/op
BenchmarkGet_valsize1MB-4 2000 1118728 ns/op
BenchmarkSet_valsize1024-4 100000 14122 ns/op
BenchmarkSet_valsize10KB-4 30000 39915 ns/op
BenchmarkSet_valsize500KB-4 1000 1052577 ns/op
BenchmarkSet_valsize1MB-4 500 2107088 ns/op
PASS
ok github.com/dgraph-io/badger-bench/store 14.876s
------------------------------------------------------------
~/work/src/github.com/dgraph-io/badger-bench/store(master) » go test -bench BenchmarkRead .
PASS
ok github.com/dgraph-io/badger-bench/store 0.058s
------------------------------------------------------------
~/work/src/github.com/dgraph-io/badger-bench/store(master) » go test -v -bench BenchmarkRead .
=== RUN TestGet
--- PASS: TestGet (0.01s)
=== RUN TestSnapshot
--- PASS: TestSnapshot (0.01s)
=== RUN TestCheckpoint
--- PASS: TestCheckpoint (0.02s)
PASS
ok github.com/dgraph-io/badger-bench/store 0.057s
More, the rw-bench package also failed:
~/work/src/github.com/dgraph-io/badger-bench/rw-bench(master) » go test -v
? github.com/dgraph-io/badger-bench/rw-bench [no test files]
------------------------------------------------------------
~/work/src/github.com/dgraph-io/badger-bench/rw-bench(master) » ./rw-bench
zsh: exec format error: ./rw-bench
~/work/src/github.com/dgraph-io/badger-bench/rw-bench(master) » go run bench.go
2018/04/17 12:05:09 Txn is too big to fit into one request
github.com/dgraph-io/badger.init
/Users/*/work/src/github.com/dgraph-io/badger/errors.go:34
main.init
<autogenerated>:1
runtime.main
/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go:186
runtime.goexit
/usr/local/Cellar/go/1.10.1/libexec/src/runtime/asm_amd64.s:2361
github.com/dgraph-io/badger/y.Wrap
/Users/*/work/src/github.com/dgraph-io/badger/y/error.go:71
github.com/dgraph-io/badger/y.Check
/Users/*/work/src/github.com/dgraph-io/badger/y/error.go:43
main.main
/Users/*/work/src/github.com/dgraph-io/badger-bench/rw-bench/bench.go:99
runtime.main
/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go:198
runtime.goexit
/usr/local/Cellar/go/1.10.1/libexec/src/runtime/asm_amd64.s:2361
exit status 1
I don't know what's the problem. Please any assistance would be greatly appreciated.
there is another error message:
~/work/src/github.com/dgraph-io/badger-bench(master) » go test -v -bench .
2018/04/17 12:54:26 no manifest found, required for read-only db
github.com/dgraph-io/badger/y.Wrap
/Users/*/work/src/github.com/dgraph-io/badger/y/error.go:71
github.com/dgraph-io/badger/y.Check
/Users/*/work/src/github.com/dgraph-io/badger/y/error.go:43
github.com/dgraph-io/badger-bench.BenchmarkReadRandomBadger
/Users/*/work/src/github.com/dgraph-io/badger-bench/bench_test.go:115
testing.(*B).runN
/usr/local/Cellar/go/1.10.1/libexec/src/testing/benchmark.go:141
testing.(*B).run1.func1
/usr/local/Cellar/go/1.10.1/libexec/src/testing/benchmark.go:214
runtime.goexit
/usr/local/Cellar/go/1.10.1/libexec/src/runtime/asm_amd64.s:2361
exit status 1
FAIL github.com/dgraph-io/badger-bench 0.018s