parser
parser copied to clipboard
`make test` fail
- What did you do?
make test
- What did you expect to see?
test pass.
- What did you see instead?
make test
gofmt (simplify)
sh test.sh
ok github.com/pingcap/parser 1.972s coverage: 74.8% of statements in ./...
ok github.com/pingcap/parser/ast 0.746s coverage: 44.5% of statements in ./...
ok github.com/pingcap/parser/auth 0.190s coverage: 0.8% of statements in ./... [no tests to run]
ok github.com/pingcap/parser/charset 0.208s coverage: 1.1% of statements in ./...
ok github.com/pingcap/parser/format 0.198s coverage: 1.4% of statements in ./...
? github.com/pingcap/parser/goyacc [no test files]
ok github.com/pingcap/parser/model 0.272s coverage: 2.0% of statements in ./...
ok github.com/pingcap/parser/mysql 0.223s coverage: 1.0% of statements in ./...
ok github.com/pingcap/parser/opcode 0.178s coverage: 0.8% of statements in ./...
PASS: terror_test.go:38: testTErrorSuite.TestErrCode 0.000s
PASS: terror_test.go:127: testTErrorSuite.TestErrorEqual 0.000s
PASS: terror_test.go:79: testTErrorSuite.TestJson 0.001s
[2020/04/30 14:05:43.919 +08:00] [ERROR] [terror.go:363] ["encountered error"] [error=xxx] [errorVerbose="xxx\ngithub.com/pingcap/parser/terror.Log\n\t/mnt/d/project/pingcap/parser/terror/terror.go:363\ngithub.com/pingcap/parser/terror.(*testTErrorSuite).TestLog\n\t/mnt/d/project/pingcap/parser/terror/terror_test.go:167\nreflect.Value.call\n\t/home/littlefall/go/src/reflect/value.go:460\nreflect.Value.Call\n\t/home/littlefall/go/src/reflect/value.go:321\ngithub.com/pingcap/check.(*suiteRunner).forkTest.func1\n\t/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/check.go:836\ngithub.com/pingcap/check.(*suiteRunner).forkCall.func1\n\t/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/check.go:730\nruntime.goexit\n\t/home/littlefall/go/src/runtime/asm_amd64.s:1373"] [stack="github.com/pingcap/log.Error\n\t/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/global.go:42\ngithub.com/pingcap/parser/terror.Log\n\t/mnt/d/project/pingcap/parser/terror/terror.go:363\ngithub.com/pingcap/parser/terror.(*testTErrorSuite).TestLog\n\t/mnt/d/project/pingcap/parser/terror/terror_test.go:167\nreflect.Value.call\n\t/home/littlefall/go/src/reflect/value.go:460\nreflect.Value.Call\n\t/home/littlefall/go/src/reflect/value.go:321\ngithub.com/pingcap/check.(*suiteRunner).forkTest.func1\n\t/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/check.go:836\ngithub.com/pingcap/check.(*suiteRunner).forkCall.func1\n\t/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/check.go:730"]
PASS: terror_test.go:165: testTErrorSuite.TestLog 0.001s
PASS: terror_test.go:43: testTErrorSuite.TestTError 0.001s
----------------------------------------------------------------------
FAIL: terror_test.go:105: testTErrorSuite.TestTraceAndLocation
terror_test.go:116:
c.Assert(len(lines)-(2*sysStack), Equals, 15, Commentf("stack =\n%s", stack))
... obtained int = 9
... expected int = 15
... stack =
[executor:123]error message:abc
github.com/pingcap/errors.AddStack
/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/errors.go:174
github.com/pingcap/parser/terror.(*Error).GenWithStack
/mnt/d/project/pingcap/parser/terror/terror.go:236
github.com/pingcap/parser/terror.call
/mnt/d/project/pingcap/parser/terror/terror_test.go:102
github.com/pingcap/parser/terror.example
/mnt/d/project/pingcap/parser/terror/terror_test.go:97
github.com/pingcap/parser/terror.(*testTErrorSuite).TestTraceAndLocation
/mnt/d/project/pingcap/parser/terror/terror_test.go:106
reflect.Value.call
/home/littlefall/go/src/reflect/value.go:460
reflect.Value.Call
/home/littlefall/go/src/reflect/value.go:321
github.com/pingcap/check.(*suiteRunner).forkTest.func1
/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/check.go:836
github.com/pingcap/check.(*suiteRunner).forkCall.func1
/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/check.go:730
runtime.goexit
/home/littlefall/go/src/runtime/asm_amd64.s:1373
OOPS: 5 passed, 1 FAILED
--- FAIL: TestT (0.01s)
FAIL
coverage: 1.4% of statements in ./...
FAIL github.com/pingcap/parser/terror 0.197s
? github.com/pingcap/parser/test_driver [no test files]
ok github.com/pingcap/parser/types 0.156s coverage: 5.7% of statements in ./...
FAIL
Makefile:6: recipe for target 'test' failed
make: *** [test] Error 1
- What version of TiDB SQL Parser are you using?
latest master, commit hash: cd0d9fe4fd07c3b85d98ffe3a6f7b887f0377e01
@LittleFall I can't reproduce in cd0d9fe. Is it still a problem now?
@LittleFall I can't reproduce in
cd0d9fe. Is it still a problem now?
littlefall@LAPTOP-NMLAI89H:/mnt/d/project/pingcap/parser$ make test
gofmt (simplify)
sh test.sh
ok github.com/pingcap/parser 2.057s coverage: 74.9% of statements in ./...
ok github.com/pingcap/parser/ast 0.684s coverage: 44.0% of statements in ./...
ok github.com/pingcap/parser/auth 0.183s coverage: 0.8% of statements in ./... [no tests to run]
ok github.com/pingcap/parser/charset 0.207s coverage: 1.1% of statements in ./...
ok github.com/pingcap/parser/format 0.204s coverage: 1.4% of statements in ./...
? github.com/pingcap/parser/goyacc [no test files]
ok github.com/pingcap/parser/model 0.209s coverage: 2.0% of statements in ./...
ok github.com/pingcap/parser/mysql 0.203s coverage: 1.0% of statements in ./...
ok github.com/pingcap/parser/opcode 0.181s coverage: 0.8% of statements in ./...
PASS: terror_test.go:38: testTErrorSuite.TestErrCode 0.000s
PASS: terror_test.go:127: testTErrorSuite.TestErrorEqual 0.000s
PASS: terror_test.go:79: testTErrorSuite.TestJson 0.001s
[2020/06/04 17:05:33.430 +08:00] [ERROR] [terror.go:363] ["encountered error"] [error=xxx] [errorVerbose="xxx\ngithub.com/pingcap/parser/terror.Log\n\t/mnt/d/project/pingcap/parser/terror/terror.go:363\ngithub.com/pingcap/parser/terror.(*testTErrorSuite).TestLog\n\t/mnt/d/project/pingcap/parser/terror/terror_test.go:167\nreflect.Value.call\n\t/home/littlefall/go/src/reflect/value.go:460\nreflect.Value.Call\n\t/home/littlefall/go/src/reflect/value.go:321\ngithub.com/pingcap/check.(*suiteRunner).forkTest.func1\n\t/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/check.go:836\ngithub.com/pingcap/check.(*suiteRunner).forkCall.func1\n\t/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/check.go:730\nruntime.goexit\n\t/home/littlefall/go/src/runtime/asm_amd64.s:1373"] [stack="github.com/pingcap/log.Error\n\t/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/global.go:42\ngithub.com/pingcap/parser/terror.Log\n\t/mnt/d/project/pingcap/parser/terror/terror.go:363\ngithub.com/pingcap/parser/terror.(*testTErrorSuite).TestLog\n\t/mnt/d/project/pingcap/parser/terror/terror_test.go:167\nreflect.Value.call\n\t/home/littlefall/go/src/reflect/value.go:460\nreflect.Value.Call\n\t/home/littlefall/go/src/reflect/value.go:321\ngithub.com/pingcap/check.(*suiteRunner).forkTest.func1\n\t/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/check.go:836\ngithub.com/pingcap/check.(*suiteRunner).forkCall.func1\n\t/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/check.go:730"]
PASS: terror_test.go:165: testTErrorSuite.TestLog 0.001s
PASS: terror_test.go:43: testTErrorSuite.TestTError 0.001s
----------------------------------------------------------------------
FAIL: terror_test.go:105: testTErrorSuite.TestTraceAndLocation
terror_test.go:116:
c.Assert(len(lines)-(2*sysStack), Equals, 15, Commentf("stack =\n%s", stack))
... obtained int = 9
... expected int = 15
... stack =
[executor:123]error message:abc
github.com/pingcap/errors.AddStack
/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/errors.go:174
github.com/pingcap/parser/terror.(*Error).GenWithStack
/mnt/d/project/pingcap/parser/terror/terror.go:236
github.com/pingcap/parser/terror.call
/mnt/d/project/pingcap/parser/terror/terror_test.go:102
github.com/pingcap/parser/terror.example
/mnt/d/project/pingcap/parser/terror/terror_test.go:97
github.com/pingcap/parser/terror.(*testTErrorSuite).TestTraceAndLocation
/mnt/d/project/pingcap/parser/terror/terror_test.go:106
reflect.Value.call
/home/littlefall/go/src/reflect/value.go:460
reflect.Value.Call
/home/littlefall/go/src/reflect/value.go:321
github.com/pingcap/check.(*suiteRunner).forkTest.func1
/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/check.go:836
github.com/pingcap/check.(*suiteRunner).forkCall.func1
/home/littlefall/gopath/pkg/mod/github.com/pingcap/[email protected]/check.go:730
runtime.goexit
/home/littlefall/go/src/runtime/asm_amd64.s:1373
OOPS: 5 passed, 1 FAILED
--- FAIL: TestT (0.01s)
FAIL
coverage: 1.4% of statements in ./...
FAIL github.com/pingcap/parser/terror 0.195s
? github.com/pingcap/parser/test_driver [no test files]
ok github.com/pingcap/parser/types 0.164s coverage: 5.7% of statements in ./...
FAIL
Makefile:6: recipe for target 'test' failed
make: *** [test] Error 1
littlefall@LAPTOP-NMLAI89H:/mnt/d/project/pingcap/parser$ git show
commit cd0d9fe4fd07c3b85d98ffe3a6f7b887f0377e01 (HEAD)
Author: kennytm <[email protected]>
Date: Mon Apr 27 19:51:12 2020 +0800
It is still failed, maybe I will try it on another computer later.