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

errors: Tests fail #44

Closed
alexanderwilling opened this issue Dec 19, 2016 · 5 comments
Closed

errors: Tests fail #44

alexanderwilling opened this issue Dec 19, 2016 · 5 comments

Comments

@alexanderwilling
Copy link
Contributor

alexanderwilling commented Dec 19, 2016

Running go test fails (go 1.7.4), because the stack formatting never matches.

@kattrali
Copy link
Contributor

Thanks for the report, @alexanderwilling. What is the full output of the tests and your go version? The tests seem to pass for me using go1.7.4 darwin/amd64. I’ll update the CI config to add the latest and possibly tip versions.

@kattrali
Copy link
Contributor

Updating the tests to include master in the build matrix sorted this out for me. Thanks again for the report!

@alexanderwilling
Copy link
Contributor Author

Sorry, I should have specified that I meant the test in the errors package/directory. Running go test there produces this output:

--- FAIL: TestStackFormatMatches (0.00s)
	error_test.go:26: Stack didn't match
	error_test.go:27: 	TestStackFormatMatches.func1: bs := [][]byte{Errorf("hi").Stack(), debug.Stack()}
		/usr/local/Cellar/go/1.7.4_1/libexec/src/runtime/asm_amd64.s:479 (0x549cc)
			call32: CALLFN(·call32, 32)
		/usr/local/Cellar/go/1.7.4_1/libexec/src/runtime/panic.go:458 (0x29243)
			gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
		/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:146 (0x72780)
			c: panic('a')
		/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:142 (0x72714)
			b: c()
		/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:137 (0x726da)
			a: b(5)
		/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:32 (0x71c18)
			TestStackFormatMatches: a()
		/usr/local/Cellar/go/1.7.4_1/libexec/src/testing/testing.go:610 (0x6a891)
			tRunner: fn(t)
		/usr/local/Cellar/go/1.7.4_1/libexec/src/runtime/asm_amd64.s:2086 (0x574c1)
			goexit: BYTE	$0x90	// NOP
	error_test.go:28: runtime/debug.Stack(0xc4200905c0, 0xc42010e000, 0x401)
			/usr/local/Cellar/go/1.7.4_1/libexec/src/runtime/debug/stack.go:24 +0x79
		github.com/bugsnag/bugsnag-go/errors.TestStackFormatMatches.func1(0xc420098180)
			/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:19 +0x170
		panic(0xef2a0, 0xc420072308)
			/usr/local/Cellar/go/1.7.4_1/libexec/src/runtime/panic.go:458 +0x243
		github.com/bugsnag/bugsnag-go/errors.c()
			/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:146 +0x60
		github.com/bugsnag/bugsnag-go/errors.b(0x5)
			/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:142 +0x14
		github.com/bugsnag/bugsnag-go/errors.a(0x8, 0x128600)
			/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:137 +0x2a
		github.com/bugsnag/bugsnag-go/errors.TestStackFormatMatches(0xc420098180)
			/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:32 +0x48
		testing.tRunner(0xc420098180, 0x128608)
			/usr/local/Cellar/go/1.7.4_1/libexec/src/testing/testing.go:610 +0x81
		created by testing.(*T).Run
			/usr/local/Cellar/go/1.7.4_1/libexec/src/testing/testing.go:646 +0x2ec
--- FAIL: TestSkipWorks (0.00s)
	error_test.go:46: Stack didn't match
	error_test.go:47: /usr/local/Cellar/go/1.7.4_1/libexec/src/runtime/panic.go:458 (0x29243)
			gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
		/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:146 (0x72780)
			c: panic('a')
		/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:142 (0x72714)
			b: c()
		/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:137 (0x726da)
			a: b(5)
		/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:52 (0x71c88)
			TestSkipWorks: a()
		/usr/local/Cellar/go/1.7.4_1/libexec/src/testing/testing.go:610 (0x6a891)
			tRunner: fn(t)
		/usr/local/Cellar/go/1.7.4_1/libexec/src/runtime/asm_amd64.s:2086 (0x574c1)
			goexit: BYTE	$0x90	// NOP
	error_test.go:48: goroutine 18 [running]:
		runtime/debug.Stack(0xc420090780, 0xc42011c400, 0x2e9)
			/usr/local/Cellar/go/1.7.4_1/libexec/src/runtime/debug/stack.go:24 +0x79
		github.com/bugsnag/bugsnag-go/errors.TestSkipWorks.func1(0xc420098300)
			/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:43 +0x18c
		panic(0xef2a0, 0xc420072638)
			/usr/local/Cellar/go/1.7.4_1/libexec/src/runtime/panic.go:458 +0x243
		github.com/bugsnag/bugsnag-go/errors.c()
			/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:146 +0x60
		github.com/bugsnag/bugsnag-go/errors.b(0x5)
			/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:142 +0x14
		github.com/bugsnag/bugsnag-go/errors.a(0x8, 0x1285f0)
			/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:137 +0x2a
		github.com/bugsnag/bugsnag-go/errors.TestSkipWorks(0xc420098300)
			/Users/alex/go/src/github.com/bugsnag/bugsnag-go/errors/error_test.go:52 +0x48
		testing.tRunner(0xc420098300, 0x1285f8)
			/usr/local/Cellar/go/1.7.4_1/libexec/src/testing/testing.go:610 +0x81
		created by testing.(*T).Run
			/usr/local/Cellar/go/1.7.4_1/libexec/src/testing/testing.go:646 +0x2ec
--- FAIL: ExampleError_Stack (0.00s)
got:
Error: Oh noes!
Stack is 600 bytes
want:
Error: Oh noes!
Stack is 589 bytes
FAIL
exit status 1
FAIL	github.com/bugsnag/bugsnag-go/errors	0.011s

@bullmo
Copy link
Contributor

bullmo commented Dec 20, 2016

It looks like the format of debug.Stack() output changed in Go 1.6 and no longer matches the format of the Stack method output on the Error.

@bullmo bullmo reopened this Dec 20, 2016
@alexanderwilling alexanderwilling changed the title Tests fail errors: Tests fail Dec 20, 2016
@kattrali
Copy link
Contributor

Ah! That makes sense. Taking a look.

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