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

stack backtrace: fix skipping #600

Merged
merged 1 commit into from Aug 30, 2019
Merged

stack backtrace: fix skipping #600

merged 1 commit into from Aug 30, 2019

Conversation

pohly
Copy link
Contributor

@pohly pohly commented Aug 30, 2019

The full backtrace included one entry too many. This only mattered
when that entry wasn't in Ginkgo itself, because otherwise pruning
removed it.

The full backtrace included one entry too many. This only mattered
when that entry wasn't in Ginkgo itself, because otherwise pruning
removed it.
@pohly
Copy link
Contributor Author

pohly commented Aug 30, 2019

@blgm: so the full stack backtrace was off by one in Ginkgo after all and #590 didn't fix it completely.

This now really cannot be tested in a Ginkgo unit test. The bug is in how codelocation.New calls PruneStack. Because the incorrectly included stack entry will match the /ginkgo/ file pattern, it will be removed before a unit test can check the result.

In the previous PR I was working around that limitation by calling PruneStack directly, but that can only test PruneStack, not New.

The failure can be seen in this Kubernetes unit test:

• Failure [0.003 seconds]
log
/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:40
  error [It]
  /nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:52

  Aug 30 16:31:44.877: hard-coded error
  Unexpected error:
      <*errors.errorString | 0xc000219bc0>: {
          s: "an error with a long, useless description",
      }
      an error with a long, useless description
  occurred

  /nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/log/logger_test.go:54

  Full Stack Trace
  k8s.io/kubernetes/test/e2e/framework.ExpectNoError(...)
  	/nvme/gopath/src/k8s.io/kubernetes/test/e2e/framework/util.go:1350
  ...

This ExpectNoError function in util.go should have been skipped. Note that the source location in logger_test.go:54 is correct, only the stacktrace isn't.

@blgm blgm merged commit 2a4c0bd into onsi:master Aug 30, 2019
@blgm
Copy link
Collaborator

blgm commented Aug 30, 2019

Thank you @pohly. Here's a new release: https://github.com/onsi/ginkgo/releases/tag/v1.10.1

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

Successfully merging this pull request may close these issues.

None yet

2 participants