sv/kdbgo

go test failed at line 47 in kdb_test.go

Closed this issue · 10 comments

With 64-bit personal edition installed, "go test -v" failed at line 47 in kdb_test.go.
Error message:

panic: runtime error: slice bounds out of range

goroutine 1 [running]:
github.com/sv/kdbgo.TestMain(0xc0000bc200)
  /home/even/Experiments/kdb/kdbgo/kdb_test.go:47 +0x813
main.main()
  _testmain.go:80 +0x13e
exit status 2
sv commented

which platform? It would mean that \p returned something without i at the end and that would be a bug

Linux even-ryzen 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64 x86_64 GNU/Linux

sv commented

Sure

KDB+ 3.6 2019.03.07 Copyright (C) 1993-2019 Kx Systems
l64/ 12(16)core 16032MB even even-ryzen 127.0.1.1 EXPIRE 2020.03.25 shinycockorach@gmail.com KOD #4164155

q)\p
0i
sv commented

cannot reproduce this. I have pushed update to kdb_test.go - could you try and see what error is printed?

Here it is:

$ go test -v
Starting q process on random port
Failed to fill port number for child process:  EOF
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
github.com/sv/kdbgo.TestMain(0xc0000bc200)
	/home/even/Experiments/kdb/kdbgo/kdb_test.go:50 +0x8a9
main.main()
	_testmain.go:80 +0x13e
exit status 2
FAIL	github.com/sv/kdbgo	0.007s
sv commented

Oh... my fault!!
It works after setting QHOME/QLIC.
However, it gives me another error message.

Starting q process on random port
Listening port is  36913
=== RUN   TestCompress
--- PASS: TestCompress (0.00s)
=== RUN   TestUncompress
--- PASS: TestUncompress (0.00s)
=== RUN   TestCompressRoundtrip
--- PASS: TestCompressRoundtrip (0.00s)
=== RUN   TestTimestampEpoch
--- PASS: TestTimestampEpoch (0.00s)
=== RUN   TestDecoding
--- FAIL: TestDecoding (0.00s)
    decode_test.go:162: Decoded '1#21:53:37.963' incorrectly. Expected '&kdb.K{Type:19, Attr:0, Data:[]int32{78817963}}', got '&kdb.K{Type:19, Attr:0, Data:[]kdb.Time{kdb.Time{wall:0x396636c0, ext:63082360417, loc:(*time.Location)(nil)}}}'
    decode_test.go:162: Decoded '21:22:01 + 1 2' incorrectly. Expected '&kdb.K{Type:18, Attr:0, Data:[]int32{76922, 76923}}', got '&kdb.K{Type:18, Attr:0, Data:[]kdb.Second{kdb.Second{wall:0x0, ext:76922, loc:(*time.Location)(nil)}, kdb.Second{wall:0x0, ext:76923, loc:(*time.Location)(nil)}}}'
    decode_test.go:162: Decoded '21:22*til 2' incorrectly. Expected '&kdb.K{Type:17, Attr:0, Data:[]int32{0, 1282}}', got '&kdb.K{Type:17, Attr:0, Data:[]kdb.Minute{kdb.Minute{wall:0x0, ext:0, loc:(*time.Location)(nil)}, kdb.Minute{wall:0x0, ext:76920, loc:(*time.Location)(nil)}}}'
    decode_test.go:162: Decoded '-8!2000.01.01' incorrectly. Expected '&kdb.K{Type:-14, Attr:0, Data:time.Time{wall:0x0, ext:63082281600, loc:(*time.Location)(nil)}}', got '&kdb.K{Type:-14, Attr:0, Data:0}'
=== RUN   TestEncoding
--- FAIL: TestEncoding (0.00s)
    encode_test.go:70: Encoded '1#2013.06.10T22:03:49.713' incorrectly. Expected '[1 0 0 0 22 0 0 0 15 0 1 0 0 0 214 129 232 88 235 45 179 64]', got '[1 0 0 0 14 0 0 0 15 0 1 0 0 0]'
    encode_test.go:70: Encoded '1#2013.06.10' incorrectly. Expected '[1 0 0 0 18 0 0 0 14 0 1 0 0 0 45 19 0 0]', got '[1 0 0 0 14 0 0 0 14 0 1 0 0 0]'
    encode_test.go:70: Encoded '`s#`a`b!2 3' incorrectly. Expected '[1 0 0 0 33 0 0 0 127 11 1 2 0 0 0 97 0 98 0 6 0 2 0 0 0 2 0 0 0 3 0 0 0]', got '[1 0 0 0 33 0 0 0 99 11 1 2 0 0 0 97 0 98 0 6 0 2 0 0 0 2 0 0 0 3 0 0 0]'
    encode_test.go:66: Encoding '-8!2000.01.01' failed:unknown type -14
=== RUN   TestConn
--- PASS: TestConn (0.00s)
=== RUN   TestConnTimeout
--- PASS: TestConnTimeout (0.00s)
=== RUN   TestConnUnix
--- PASS: TestConnUnix (0.00s)
=== RUN   TestConnTLS
--- FAIL: TestConnTLS (0.00s)
    kdb_test.go:124: Failed to connect to test instance via TLS: read tcp 127.0.0.1:58718->127.0.0.1:36913: read: connection reset by peer
=== RUN   TestSyncCall
Q stderr output: '2019.04.20T23:22:04.440 TLS not enabled

Testing sync function call
--- PASS: TestSyncCall (0.01s)
=== RUN   TestSyncCallCompress
Testing sync function call with large data compression
Result: 312499987500000 <nil>
--- PASS: TestSyncCallCompress (0.94s)
=== RUN   TestSyncCallUnix
Testing sync function call via UDS
--- PASS: TestSyncCallUnix (0.00s)
=== RUN   TestSyncCallTLS
--- FAIL: TestSyncCallTLS (0.00s)
    kdb_test.go:180: Failed to connect to test instance via TLS: read tcp 127.0.0.1:58724->127.0.0.1:36913: read: connection reset by peer
=== RUN   TestAsyncCall
Q stderr output: '2019.04.20T23:22:05.390 TLS not enabled

Result: true <nil>
--- PASS: TestAsyncCall (0.00s)
=== RUN   TestResponse
--- PASS: TestResponse (0.00s)
FAIL
Q stdout error: EOF
Q stderr output:
Q stderr error: EOF
exit status 1
FAIL	github.com/sv/kdbgo	1.938s
sv commented

Got it!
Thanks for quickly replies.