h2go
h2go copied to clipboard
Tests fail with H2_TEST_IN_MEMORY=false (h2-2.3.232.jar)
Tests fail with file-backed H2 database:
$ H2_TEST_IN_MEMORY=false go test ./... -count=1 -v
=== RUN TestPing
driver_test.go:49: error: driver: bad connection
--- FAIL: TestPing (0.01s)
=== RUN TestSimpleCRUD
driver_test.go:49: error: SQL Error: unknown: Can't read all data needed
driver_test.go:49: error: write tcp 127.0.0.1:43028->127.0.0.1:9092: write: broken pipe
--- FAIL: TestSimpleCRUD (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x593ae7]
goroutine 35 [running]:
testing.tRunner.func1.2({0x5b9b60, 0x75f0a0})
/opt/go1.23.2/src/testing/testing.go:1632 +0x230
testing.tRunner.func1()
/opt/go1.23.2/src/testing/testing.go:1635 +0x35e
panic({0x5b9b60?, 0x75f0a0?})
/opt/go1.23.2/src/runtime/panic.go:785 +0x132
github.com/jmrobles/h2go.TestSimpleCRUD.func1(0xc00002c360)
/home/user/foss/h2go/driver_test.go:133 +0x147
github.com/jmrobles/h2go.runTests(0xc000156000, {0xc000111f58, 0x1, 0x4ea6b3?})
/home/user/foss/h2go/driver_test.go:95 +0x190
github.com/jmrobles/h2go.TestSimpleCRUD(0xc000156000?)
/home/user/foss/h2go/driver_test.go:123 +0x2c
testing.tRunner(0xc000156000, 0x601158)
/opt/go1.23.2/src/testing/testing.go:1690 +0xf4
created by testing.(*T).Run in goroutine 1
/opt/go1.23.2/src/testing/testing.go:1743 +0x390
FAIL github.com/jmrobles/h2go 0.022s
FAIL
Exit code: 1
Same tests run fine with in-memory database (requires removing examples/ directory first):
$ H2_TEST_IN_MEMORY=true go test ./... -count=1 -v
=== RUN TestPing
--- PASS: TestPing (0.01s)
=== RUN TestSimpleCRUD
--- PASS: TestSimpleCRUD (0.01s)
=== RUN TestCRUDwithParameters
--- PASS: TestCRUDwithParameters (0.01s)
=== RUN TestDateTimeTypes
--- PASS: TestDateTimeTypes (0.01s)
=== RUN TestOtherTypes
--- PASS: TestOtherTypes (0.01s)
=== RUN TestStmt
--- PASS: TestStmt (0.01s)
=== RUN TestTx
--- PASS: TestTx (0.01s)
PASS
ok github.com/jmrobles/h2go 0.061s
I've tested with current version of H2: h2-2.3.232.jar from http://www.h2database.com/html/download.html