Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go test -v panic #47

Open
jimdn opened this issue Jul 3, 2019 · 3 comments
Open

go test -v panic #47

jimdn opened this issue Jul 3, 2019 · 3 comments

Comments

@jimdn
Copy link

jimdn commented Jul 3, 2019

go test -v
=== RUN TestOpenConnection
--- PASS: TestOpenConnection (0.00s)
=== RUN TestQuery
--- FAIL: TestQuery (0.06s)
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=0x10 pc=0x6bf29c]

goroutine 8 [running]:
testing.tRunner.func1(0xc000104200)
/usr/lib/golang/src/testing/testing.go:792 +0x387
panic(0x712840, 0x9cf200)
/usr/lib/golang/src/runtime/panic.go:513 +0x1b9
sqlflow.org/gohive.drv.Open(0x776384, 0x15, 0x1e, 0xc000055b28, 0x435b0c, 0xc000055b60)
/home/jimmydeng/go/src/sqlflow.org/gohive/driver.go:53 +0x1ac
database/sql.dsnConnector.Connect(0x776384, 0x15, 0x7c2140, 0x9f8800, 0x7c4c80, 0xc000014098, 0x0, 0x0, 0x0, 0x0)
/usr/lib/golang/src/database/sql/sql.go:637 +0x45
database/sql.(*DB).conn(0xc00010a180, 0x7c4c80, 0xc000014098, 0x40db01, 0x4368be, 0xc0000425a8, 0x459ad0)
/usr/lib/golang/src/database/sql/sql.go:1177 +0x135
database/sql.(*DB).query(0xc00010a180, 0x7c4c80, 0xc000014098, 0x77d0ef, 0x24, 0x0, 0x0, 0x0, 0xc000076601, 0xc0000426f0, ...)
/usr/lib/golang/src/database/sql/sql.go:1514 +0x66
database/sql.(*DB).QueryContext(0xc00010a180, 0x7c4c80, 0xc000014098, 0x77d0ef, 0x24, 0x0, 0x0, 0x0, 0x15, 0x7c2140, ...)
/usr/lib/golang/src/database/sql/sql.go:1496 +0xd3
database/sql.(*DB).Query(0xc00010a180, 0x77d0ef, 0x24, 0x0, 0x0, 0x0, 0x0, 0x9a088a, 0x26)
/usr/lib/golang/src/database/sql/sql.go:1510 +0x82
sqlflow.org/gohive.TestQuery(0xc000104200)
/home/jimmydeng/go/src/sqlflow.org/gohive/driver_test.go:19 +0x96
testing.tRunner(0xc000104200, 0x789b68)
/usr/lib/golang/src/testing/testing.go:827 +0xbf
created by testing.(*T).Run
/usr/lib/golang/src/testing/testing.go:878 +0x353
exit status 2
FAIL sqlflow.org/gohive 0.071s

@typhoonzero
Copy link
Collaborator

Are you running go test in the docker container sqlflow/gohive:dev or on somewhere else?

@jimdn
Copy link
Author

jimdn commented Jul 4, 2019

Fisrt i downloaded sqlflow.org/gohive and put it to my GOPATH, then I run go test -v in my own HADOOP environment:
hadoop-2.7.7
hive-2.3.4
The first TestCase was passed which is testing the connection.
But exec db.Query in the next TestCase, it panic.

@weiguoz
Copy link
Collaborator

weiguoz commented Jul 4, 2019

We test gohive in a docker container. ref

TestOpenConnection initializes the configuration but does not connect to the hive server. I would suggest running the TestPing or db.Query to check the connection status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants