Skip to content

Cleanup tests - #4300

Merged
jetstack-bot merged 6 commits into
cert-manager:masterfrom
inteon:fix_test_flake_2
Aug 7, 2021
Merged

jetstack-bot merged 6 commits into
cert-manager:masterfrom
inteon:fix_test_flake_2

Conversation

@inteon

@inteon inteon commented Aug 3, 2021 •

Copy link
Copy Markdown
Member

What this PR does / why we need it:
Cleanup integration tests, use the correct context and gracefully shutdown.
Return error if shutdown was not successful.

Fixes flakes similar to:
https://prow.build-infra.jetstack.net/view/gs/jetstack-logs/pr-logs/pull/jetstack_cert-manager/4298/pull-cert-manager-bazel/1422663871339958274

This PR also fixes:

  • run-e2e.sh flag was not passed correctly
  • remove tiller.go file
  • improved error logging
  • set DomainSuffix to a correct default value
  • add NextPrivateKeySecretName == nil check for certificate to be considered stable
  • escape commas in featureGate

fixes #4284
fixes #4066

Release note:

/kind cleanup

@jetstack-bot jetstack-bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. area/testing Issues relating to testing needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 3, 2021
@jetstack-bot

Copy link
Copy Markdown
Contributor

Hi @inteon. Thanks for your PR.

I'm waiting for a jetstack or cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jetstack-bot jetstack-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Aug 3, 2021
@wallrj

wallrj commented Aug 4, 2021

Copy link
Copy Markdown
Member

/ok-to-test

@jetstack-bot jetstack-bot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 4, 2021

@wallrj wallrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@inteon Please rebase this now that #4298 has merged.

@inteon
inteon force-pushed the fix_test_flake_2 branch from 4c4b272 to d4d304e Compare August 5, 2021 16:59
@inteon
inteon requested a review from wallrj August 5, 2021 17:00
@jetstack-bot jetstack-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 5, 2021
if err != nil {
pretty.Logln("cert:", testCertificate)
testCertificate, _ = f.Helper().WaitForCertificateReadyAndDoneIssuing(testCertificate, time.Minute*5)
pretty.Logln("re-fetched:", testCertificate)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@jakexks @wallrj these print statements should give some more insights into what causes the "Expected certificate expiry date to be 2026-08-05 17:22:43 +0100 BST, but got 2026-08-05 16:23:13 +0000 UTC" error.
I'm however not able to replicated the issue on my machine. Could someone try this and share the results?

@wallrj wallrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @inteon

I ran the integration tests and the Gateway E2E tests locally and they passed, multiple times.

Just to be clear, the core problem was that we weren't waiting for integration test API servers to shutdown and release their listening sockets? So subsequent tests would attempt to connect to still shutting down servers. Is that right?

I also asked about some seemingly unrelated changes below. Please just say a few words about the reason for each of those changes.

Then unhold and merge if you're happy with all this.

/lgtm
/hold

Comment thread cmd/webhook/app/testing/testwebhook.go Resolved
Comment thread test/e2e/framework/config/BUILD.bazel Resolved
log.Logf("Observed certificate conditions:\n")
for _, cond := range certificate.Status.Conditions {
log.Logf("- Last Status: '%s' Reason: '%s', Message: '%s'\n", cond.Status, cond.Reason, cond.Message)
log.Logf("- Last '%s' Status: '%s' Reason: '%s', Message: '%s'\n", cond.Type, cond.Status, cond.Reason, cond.Message)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That'll make it easier to discern the condition logs. Thanks.

Comment thread devel/run-e2e.sh Outdated
--acme-dns-server="$DNS_SERVER" \
--acme-ingress-ip="$INGRESS_IP" \
"${SKIP}" \
${SKIP} \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The quotes didn't cause a problem for me. What problem did you encounter?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

./devel/run-e2e.sh --ginkgo.focus "basicConstraint" does not work on my computer, it just ignores the --ginkgo.focus flag

@jetstack-bot jetstack-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 6, 2021
@jetstack-bot jetstack-bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 6, 2021
@inteon inteon changed the title Cleanup integration tests Cleanup tests Aug 6, 2021
@inteon
inteon force-pushed the fix_test_flake_2 branch from 0ba3102 to 7cd156d Compare August 6, 2021 12:23
@jetstack-bot jetstack-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2021
@inteon
inteon force-pushed the fix_test_flake_2 branch from 7cd156d to e045388 Compare August 6, 2021 12:57
@inteon

inteon commented Aug 6, 2021

Copy link
Copy Markdown
Member Author

/retest

@inteon
inteon force-pushed the fix_test_flake_2 branch from e045388 to ef31a2e Compare August 6, 2021 15:37
@jetstack-bot jetstack-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2021

@wallrj wallrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2021
@wallrj

wallrj commented Aug 6, 2021 •

Copy link
Copy Markdown
Member

Release "cert-manager" does not exist. Installing it now.
Error: timed out waiting for the condition
-- https://prow.build-infra.jetstack.net/view/gs/jetstack-logs/pr-logs/pull/jetstack_cert-manager/4300/pull-cert-manager-e2e-v1-21/1423669649756655616

@inteon That was the last E2E test failure. Do you think it might be because we don't allow long enough for the startupapicheck Job?
It drives me mad that the Prow logs don't have any timestamps.
And also that the helm install command doesn't give a little more detail about what it was waiting for that timed out.

Perhaps we should add the helm --debug flag to the install script.

$ helm help

Flags:
      --debug                       enable verbose output

@inteon

inteon commented Aug 6, 2021

Copy link
Copy Markdown
Member Author

/retest

Signed-off-by: Inteon <[email protected]>
@jetstack-bot jetstack-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2021
@inteon
inteon force-pushed the fix_test_flake_2 branch 2 times, most recently from 005d857 to 347cd6c Compare August 6, 2021 20:21
@jetstack-bot jetstack-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 7, 2021

@jakexks jakexks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🥳
/lgtm
/cherrypick release-1.5

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 7, 2021
@jetstack-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: inteon, jakexks, wallrj

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

The pull request process is described here

Details 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

@jetstack-bot
jetstack-bot merged commit 4323040 into cert-manager:master Aug 7, 2021
@jetstack-bot jetstack-bot added this to the v1.5 milestone Aug 7, 2021
@wallrj

wallrj commented Aug 7, 2021

Copy link
Copy Markdown
Member

/cherry-pick release-1.5

@jetstack-bot

Copy link
Copy Markdown
Contributor

@wallrj: #4300 failed to apply on top of branch "release-1.5":

Applying: cleanup test contexts
Applying: cleanup & better error debug printing
Using index info to reconstruct a base tree...
M	test/e2e/framework/helper/BUILD.bazel
M	test/e2e/framework/helper/certificates.go
M	test/e2e/framework/helper/validate.go
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/framework/helper/validate.go
Auto-merging test/e2e/framework/helper/certificates.go
CONFLICT (content): Merge conflict in test/e2e/framework/helper/certificates.go
Auto-merging test/e2e/framework/helper/BUILD.bazel
CONFLICT (content): Merge conflict in test/e2e/framework/helper/BUILD.bazel
Removing test/e2e/framework/config/tiller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 cleanup & better error debug printing
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Details

In response to this:

/cherry-pick release-1.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@wallrj

wallrj commented Aug 7, 2021

Copy link
Copy Markdown
Member

/cherry-pick release-1.5

@jetstack-bot

Copy link
Copy Markdown
Contributor

@wallrj: #4300 failed to apply on top of branch "release-1.5":

Applying: cleanup test contexts
Applying: cleanup & better error debug printing
Applying: add better logging
Applying: escape commas
Using index info to reconstruct a base tree...
M	devel/addon/certmanager/install.sh
Falling back to patching base and 3-way merge...
Auto-merging devel/addon/certmanager/install.sh
CONFLICT (content): Merge conflict in devel/addon/certmanager/install.sh
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0004 escape commas
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Details

In response to this:

/cherry-pick release-1.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@wallrj

wallrj commented Aug 7, 2021

Copy link
Copy Markdown
Member

/cherry-pick release-1.5

@jetstack-bot

Copy link
Copy Markdown
Contributor

@wallrj: new pull request created: #4324

Details

In response to this:

/cherry-pick release-1.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@inteon
inteon deleted the fix_test_flake_2 branch August 10, 2021 09:49
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/testing Issues relating to testing dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. ok-to-test release-note-none Denotes a PR that doesn't merit a release note. 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.

Remove Tiller from e2e [Flake] test/e2e/suite/issuers/acme/certificate/http01.go test

4 participants