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

Flaky: TestAllocatorAllocatePriority #3280

Merged

Conversation

markmandel
Copy link
Member

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking
/kind bug

/kind cleanup

/kind documentation
/kind feature
/kind hotfix
/kind release

What this PR does / Why we need it:

Fix a flake that would see a feature flag flip just between ApplyDefaults() and Validate() -- which is more impressive than anything else.

--- FAIL: TestAllocatorAllocatePriority (1.18s)
    allocator_test.go:169:
        	Error Trace:	/go/src/agones.dev/agones/pkg/gameserverallocations/allocator_test.go:169
        	            				/go/src/agones.dev/agones/pkg/gameserverallocations/allocator_test.go:176
        	Error:      	"[spec.selectors[0].counters: Forbidden: Feature CountsAndLists must be enabled spec.selectors[0].lists: Forbidden: Feature CountsAndLists must be enabled]" should have 0 item(s), but has 2
        	Test:       	TestAllocatorAllocatePriority

Which issue(s) this PR fixes:

N/A

Special notes for your reviewer:

@markmandel markmandel added the area/tests Unit tests, e2e tests, anything to make sure things don't break label Jul 20, 2023
@github-actions github-actions bot added the kind/cleanup Refactoring code, fixing up documentation, etc label Jul 20, 2023
Copy link
Collaborator

@gongmax gongmax left a comment

Choose a reason for hiding this comment

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

Interesting finding!

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gongmax, markmandel

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

@markmandel
Copy link
Member Author

Just happened to happen to me on PR #3279!

Copy link
Collaborator

@igooch igooch left a comment

Choose a reason for hiding this comment

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

This wasn't the test that flaked, it was func TestAllocatorAllocatePriority. Does this lock need to be added to all the tests?

Or should this be added to func TestAllocatorApplyAllocationToGameServerCountsListsActions after t.Parallel instead of processing for each test case?

	runtime.FeatureTestMutex.Lock()
	defer runtime.FeatureTestMutex.Unlock()
	assert.NoError(t, runtime.ParseFeatures(string(runtime.FeatureCountsAndLists)+"=true"))

@markmandel
Copy link
Member Author

This wasn't the test that flaked, it was func TestAllocatorAllocatePriority. Does this lock need to be added to all the tests?

You raise a really good point! That's what I get for moving too fast.

I'll add it to the other tests this could possibly affect in this file.

Fix a flake that would see a feature flag flip _just_ between
`ApplyDefaults()` and `Validate()` -- which is more impressive than
anything else.

```
--- FAIL: TestAllocatorAllocatePriority (1.18s)
    allocator_test.go:169:
        	Error Trace:	/go/src/agones.dev/agones/pkg/gameserverallocations/allocator_test.go:169
        	            				/go/src/agones.dev/agones/pkg/gameserverallocations/allocator_test.go:176
        	Error:      	"[spec.selectors[0].counters: Forbidden: Feature CountsAndLists must be enabled spec.selectors[0].lists: Forbidden: Feature CountsAndLists must be enabled]" should have 0 item(s), but has 2
        	Test:       	TestAllocatorAllocatePriority
```
@markmandel markmandel force-pushed the flaky/TestAllocatorAllocatePriority branch from 25dfb80 to 8a923ae Compare July 20, 2023 19:54
@google-oss-prow google-oss-prow bot removed the lgtm label Jul 20, 2023
@google-oss-prow
Copy link

New changes are detected. LGTM label has been removed.

@google-oss-prow google-oss-prow bot added size/S and removed size/XS labels Jul 20, 2023
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 69f98d7e-683c-4e8a-8d94-43762413eaf5

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: b5876326-b6dd-4b1f-9f0d-578b250406ea

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3280/head:pr_3280 && git checkout pr_3280
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.34.0-dev-b27da5c-amd64

@markmandel markmandel merged commit 2010cec into googleforgames:main Jul 20, 2023
2 checks passed
@markmandel markmandel deleted the flaky/TestAllocatorAllocatePriority branch July 20, 2023 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/tests Unit tests, e2e tests, anything to make sure things don't break kind/cleanup Refactoring code, fixing up documentation, etc size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants