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

Ginkgo update + stack fix #82176

Merged
merged 7 commits into from Oct 5, 2019
Merged

Conversation

pohly
Copy link
Contributor

@pohly pohly commented Aug 30, 2019

What type of PR is this?
/kind cleanup

What this PR does / why we need it:

After merging
259bb3b#diff-eb7b79470992813ea1905e96c298b47b
ExpectEqual and some of the other wrappers logged the failure twice,
once inside the wrapper itself and once in the failure handler.

Logging the stack backtrace is useful because many assertions still
don't contain an explanation and therefore knowing where they occur is
crucial. Now all failures are logged with a "Full Stack Trace", not
just those with a wrapper. The stack is pruned to skip over wrapper
functions and removes Ginkgo internal functions to keep the stack
trace smaller.

Failures occurring in the wrappers were recorded as occurring in those
wrappers. Now the wrappers are skipped and the caller is recorded
instead.

Fixes: #82013

Does this PR introduce a user-facing change?:

more complete and accurate logging of stack backtraces in E2E failures

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Aug 30, 2019
@pohly
Copy link
Contributor Author

pohly commented Aug 30, 2019

This is WIP because Ginkgo 1.10.0 still isn't quite working correctly: onsi/ginkgo#600

@k8s-ci-robot k8s-ci-robot added area/apiserver area/cloudprovider area/dependency Issues or PRs related to dependency changes area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/kubectl area/test sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 30, 2019
@pohly pohly changed the title WIP: Ginkgo update + stack fix Ginkgo update + stack fix Aug 30, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 30, 2019
@pohly
Copy link
Contributor Author

pohly commented Aug 30, 2019

/retest

@@ -48,8 +51,9 @@ func Failf(format string, args ...interface{}) {
// (for example, for call chain f -> g -> FailfWithOffset(1, ...) error would be logged for "f").
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: nice to add Stack Trace also in this explanation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -19,6 +19,9 @@ package log

import (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pohly This e2elog package will be removed as line 17.
Could you apply this change to test/e2e/framework/log.go ?
I did mistake to forget copying the unit test to test/e2e/framework/log_test.go with #81426
Sorry about that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I've moved it and also some of the util.go functions that are only used in log.go. I also updated the comment in framework/e2e/log/logger.go to be more explicit.

// entries coming from Ginkgo.
//
// This is a copy of https://github.com/onsi/ginkgo/blob/f90f37d87fa6b1dd9625e2b1e83c23ffae3de228/internal/codelocation/code_location.go#L25
func PrunedStack(skip int) string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original function name is PruneStack in ginkgo. I guess this name (with d) is intentional, right?
(I tried to search this name in ginkgo repo, and I missed that with the name)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally renamed it, because this version is simpler and returns the "pruned stack" instead of taking an arbitrary string and pruning it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added "This is a modified copy of PruneStack in ..."

@oomichi
Copy link
Member

oomichi commented Aug 30, 2019

/cc @oomichi

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed area/cloudprovider area/apiserver do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 1, 2019
Copy link
Member

@timothysc timothysc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@timothysc
Copy link
Member

/assign @liggitt
^ requires approval for dep changes.

@liggitt
Copy link
Member

liggitt commented Oct 3, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, oomichi, pohly, timothysc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 3, 2019
@alejandrox1
Copy link
Contributor

@pohly could you try doing a git commit --amend && git push -f origin ginkgo-stack-fix to try and remove the needs-rebase label ? 🤔

@cblecker
Copy link
Member

cblecker commented Oct 4, 2019

/test all

@cblecker cblecker removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 4, 2019
Updated to keep both Ginkgo and Gomega at the latest releases.
@k8s-ci-robot k8s-ci-robot added area/apiserver area/cloudprovider area/kubectl sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Oct 4, 2019
@pohly
Copy link
Contributor Author

pohly commented Oct 4, 2019

could you try doing a git commit --amend && git push -f origin ginkgo-stack-fix to try and remove the needs-rebase label ?

Done. @alejandrox1 now you need to LGTM again.

@oomichi
Copy link
Member

oomichi commented Oct 4, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 4, 2019
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit b140b43 into kubernetes:master Oct 5, 2019
wking pushed a commit to wking/kubernetes that referenced this pull request Jul 21, 2020
Ginkgo update + stack fix

Kubernetes-commit: b140b43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver area/cloudprovider area/dependency Issues or PRs related to dependency changes area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/kubectl area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

full stack trace in E2E testing incorrect (Ginkgo bug)
10 participants