Run all api_test.go test cases. This will fail with the stack below. This is happening because the first test case locks the DB, and then in the same process in the second test case, it tries to destroy the DB. We either need to see if the lock can be released or use a different DB name for each test case.
17:18:24.898 [server] SetupTestConfig -> DEBU 001 setting Number of procs to 2, was 1
Error opening DB IO error: lock /tmp/OpenchainAPITestChain0/LOCK: No locks available
--- FAIL: TestServerOpenchain_API_GetBlockByNumber-2 (0.00s)
api_test.go:152: Error destroying chain0 DB IO error: lock /tmp/OpenchainAPITestChain0/LOCK: No locks available
api_test.go:158: Error destroying state0 DB IO error: lock /tmp/OpenchainAPITestState0/LOCK: No locks available
api_test.go:164: Error creating chain0: IO error: lock /tmp/OpenchainAPITestChain0/LOCK: No locks available
api_test.go:168: Chain 0 =>
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x467f55]
goroutine 9 [running]:
testing.func·006()
/opt/go/src/testing/testing.go:441 +0x181
github.com/openblockchain/obc-peer/openchain.(*ServerOpenchain).GetBlockByNumber(0xc208097df0, 0x7f98a3dcd230, 0xc20800b240, 0xc208097dc8, 0x1, 0x0, 0x0)
/opt/gopath/src/github.com/openblockchain/obc-peer/openchain/api.go:77 +0x2f5
github.com/openblockchain/obc-peer/openchain.TestServerOpenchain_API_GetBlockByNumber(0xc208138510)
/opt/gopath/src/github.com/openblockchain/obc-peer/openchain/api_test.go:173 +0x71b
testing.tRunner(0xc208138510, 0xf0a030)
/opt/go/src/testing/testing.go:447 +0xbf
created by testing.RunTests
/opt/go/src/testing/testing.go:555 +0xa8b
goroutine 1 [chan receive]:
testing.RunTests(0xb530d8, 0xf0a000, 0x16, 0x16, 0xc208112901)
/opt/go/src/testing/testing.go:556 +0xad6
testing.(*M).Run(0xc2080f0fa0, 0xc2080b6160)
/opt/go/src/testing/testing.go:485 +0x6c
github.com/openblockchain/obc-peer/openchain.TestMain(0xc2080f0fa0)
/opt/gopath/src/github.com/openblockchain/obc-peer/openchain/peer_test.go:48 +0x18c
main.main()
github.com/openblockchain/obc-peer/openchain/_test/_testmain.go:98 +0x1d1
goroutine 17 [select]:
google.golang.org/grpc/transport.(*http2Client).controller(0xc208140000)
/opt/gopath/src/google.golang.org/grpc/transport/http2_client.go:799 +0x61f
created by google.golang.org/grpc/transport.newHTTP2Client
/opt/gopath/src/google.golang.org/grpc/transport/http2_client.go:193 +0x158f
goroutine 18 [IO wait]:
net.(_pollDesc).Wait(0xc2080119c0, 0x72, 0x0, 0x0)
/opt/go/src/net/fd_poll_runtime.go:84 +0x47
net.(_pollDesc).WaitRead(0xc2080119c0, 0x0, 0x0)
/opt/go/src/net/fd_poll_runtime.go:89 +0x43
net.(_netFD).Read(0xc208011960, 0xc208138024, 0x9, 0x9, 0x0, 0x7f98a3dca158, 0xc208111bb8)
/opt/go/src/net/fd_unix.go:242 +0x40f
net.(_conn).Read(0xc20812c000, 0xc208138024, 0x9, 0x9, 0x0, 0x0, 0x0)
/opt/go/src/net/net.go:121 +0xdc
io.ReadAtLeast(0x7f98a3dcd098, 0xc20812c000, 0xc208138024, 0x9, 0x9, 0x9, 0x0, 0x0, 0x0)
/opt/go/src/io/io.go:298 +0xf1
io.ReadFull(0x7f98a3dcd098, 0xc20812c000, 0xc208138024, 0x9, 0x9, 0xc208110004, 0x0, 0x0)
/opt/go/src/io/io.go:316 +0x6d
github.com/bradfitz/http2.readFrameHeader(0xc208138024, 0x9, 0x9, 0x7f98a3dcd098, 0xc20812c000, 0x0, 0xc200000000, 0x0, 0x0)
/opt/gopath/src/github.com/bradfitz/http2/frame.go:228 +0xa2
github.com/bradfitz/http2.(_Framer).ReadFrame(0xc208138000, 0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/bradfitz/http2/frame.go:373 +0xf2
google.golang.org/grpc/transport.(_framer).readFrame(0xc20812a090, 0x0, 0x0, 0x0, 0x0)
/opt/gopath/src/google.golang.org/grpc/transport/http_util.go:453 +0x50
google.golang.org/grpc/transport.(*http2Client).reader(0xc208140000)
/opt/gopath/src/google.golang.org/grpc/transport/http2_client.go:729 +0x12d
created by google.golang.org/grpc/transport.newHTTP2Client
/opt/gopath/src/google.golang.org/grpc/transport/http2_client.go:199 +0x15e6
goroutine 19 [select]:
google.golang.org/grpc.(*ClientConn).transportMonitor(0xc2080b6160)
/opt/gopath/src/google.golang.org/grpc/clientconn.go:383 +0x28c
created by google.golang.org/grpc.Dial
/opt/gopath/src/google.golang.org/grpc/clientconn.go:188 +0x5c5
goroutine 33 [syscall, locked to thread]:
runtime.goexit()
/opt/go/src/runtime/asm_amd64.s:2232 +0x1