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

tests: Fix flaky TestWatchNamespaceSelector #10160

Merged
merged 4 commits into from
Oct 3, 2024
Merged

Conversation

davidjumani
Copy link
Contributor

@davidjumani davidjumani commented Oct 3, 2024

Description

Fixes the flaky TestMatchLabels that could be caused by not removing the label on a namespace after the test.
The presence of the label on the namespace (from the prior test even though the namespace was deleted???) could be present which causes the test to flake - maybe translation takes a bit of time to process the deleted namespace and its resources which is longer than it takes for the next test to begin ??
I've run this test ~20 times without flakes so it appears to be stable now

Fixes #10160 once backported

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@github-actions github-actions bot added keep pr updated signals bulldozer to keep pr up to date with base branch work in progress signals bulldozer to keep pr open (don't auto-merge) labels Oct 3, 2024
@davidjumani davidjumani removed the work in progress signals bulldozer to keep pr open (don't auto-merge) label Oct 3, 2024
Copy link

github-actions bot commented Oct 3, 2024

Visit the preview URL for this PR (updated for commit f5c4dfd):

https://gloo-edge--pr10160-fix-watch-ns-mjgy3a5i.web.app

(expires Thu, 10 Oct 2024 15:19:16 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 77c2b86e287749579b7ff9cadb81e099042ef677

@@ -59,6 +59,11 @@ func (s *testingSuite) testWatchNamespaceSelector(key, value string) {

// The VS defined in the random namespace should be translated
s.TestInstallation.Assertions.CurlEventuallyRespondsWithStatus(s.Ctx, "random/", http.StatusOK)

s.unwatchNamespace(key)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a "cleanup" step and therefore we should consider performing it in the AfterTest method, or in a deferred function so it is always executed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's only for this specific test and it also serves as a way to verify that unlabelling a namespace leads to the resources defined in it to not be translated

@@ -210,7 +210,7 @@ analyze:

GINKGO_VERSION ?= $(shell echo $(shell go list -m github.com/onsi/ginkgo/v2) | cut -d' ' -f2)
GINKGO_ENV ?= GOLANG_PROTOBUF_REGISTRATION_CONFLICT=ignore ACK_GINKGO_RC=true ACK_GINKGO_DEPRECATIONS=$(GINKGO_VERSION)
GINKGO_FLAGS ?= -tags=purego --trace -progress -race --fail-fast -fail-on-pending --randomize-all --compilers=5
GINKGO_FLAGS ?= -tags=purego --trace -progress -race --fail-fast -fail-on-pending --randomize-all --compilers=5 --flake-attempts=3
Copy link
Contributor

Choose a reason for hiding this comment

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

This will affect all times we invoke these tests, on PRs and nightlies. I'm good with this, though initially i had envisioned we would only add this for PRs, so that nightlies still give us a good signal. wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since I assume the plan is to eventually move away from ginkgo, this should be fine as long as we make strides to migrate tests

@danehans
Copy link
Contributor

danehans commented Oct 3, 2024

@davidjumani do you mind adding Fixes #10160 to the PR description to close out the associated issue?

@davidjumani
Copy link
Contributor Author

@davidjumani do you mind adding Fixes #10160 to the PR description to close out the associated issue?

I'll close out the issue when this is backported to 1.17

@@ -210,7 +210,7 @@ analyze:

GINKGO_VERSION ?= $(shell echo $(shell go list -m github.com/onsi/ginkgo/v2) | cut -d' ' -f2)
GINKGO_ENV ?= GOLANG_PROTOBUF_REGISTRATION_CONFLICT=ignore ACK_GINKGO_RC=true ACK_GINKGO_DEPRECATIONS=$(GINKGO_VERSION)
GINKGO_FLAGS ?= -tags=purego --trace -progress -race --fail-fast -fail-on-pending --randomize-all --compilers=5
GINKGO_FLAGS ?= -tags=purego --trace -progress -race --fail-fast -fail-on-pending --randomize-all --compilers=5 --flake-attempts=3
Copy link
Contributor

Choose a reason for hiding this comment

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

i'm in favor of reverting this change so we can catch flakes more easily

@jenshu jenshu mentioned this pull request Oct 3, 2024
4 tasks
@soloio-bulldozer soloio-bulldozer bot merged commit 8a101dd into main Oct 3, 2024
19 checks passed
@soloio-bulldozer soloio-bulldozer bot deleted the fix-watch-ns branch October 3, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep pr updated signals bulldozer to keep pr up to date with base branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants