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

move StateAllocationFilter to stable #3238

Closed

Conversation

ashutosji
Copy link
Contributor

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

What this PR does / Why we need it:

Which issue(s) this PR fixes:

Closes ##3096

Special notes for your reviewer:

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ashutosji
Once this PR has been reviewed and has the lgtm label, please assign alekser for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@github-actions github-actions bot added the kind/feature New features for Agones label Jun 28, 2023
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 39f18679-2c84-4882-a8ab-fd2b5093cc29

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

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 34af16e5-21a4-4164-8bd5-b273e4bf67ac

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

@markmandel
Copy link
Member

markmandel commented Jun 28, 2023

I see a couple of failing tests - TestFindGameServerForAllocationPacked and TestFindGameServerForAllocationPacked/one_label in the unit tests.

Are they also failing for you locally? Are you able to reproduce the issues?

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

Good start! Gave you some direction on how to tidy it up.

Haven't looked into why the tests are failing, but let us know what you find and we'll narrow it down if you are struggling with it.

c.matcher = readyOrAllocatedGameServerMatcher
}

Copy link
Member

Choose a reason for hiding this comment

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

We could clean up up more, and replace the matcher above on line 66 directly with the readyOrAllocatedGameServerMatcher -- and we could delete the readyGameServerMatcher function entirely.

(There's possibly a good reason to get rid of matcher as a data structure entirely, since we don't need to switch it out at runtime anymore).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I forgot it. Thanks for reminding i will correct that.

Comment on lines 538 to 539
runtime.FeatureTestMutex.Lock()
defer runtime.FeatureTestMutex.Unlock()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
runtime.FeatureTestMutex.Lock()
defer runtime.FeatureTestMutex.Unlock()

Since we have no feature flags set, we don't need the mutex anymore.

We do this because Go tests run in parallel, but feature flags are stored globally, so this allows us to have tests that don't collide. No feature flags here anymore means we don't need the mutex anymore!

@@ -94,7 +94,7 @@ func TestFindGameServerForAllocationPacked(t *testing.T) {
{ObjectMeta: metav1.ObjectMeta{Name: "gs6", Namespace: "does-not-apply", Labels: oneLabel}, Status: agonesv1.GameServerStatus{NodeName: "node1", State: agonesv1.GameServerStateReady}},
},
test: func(t *testing.T, list []*agonesv1.GameServer) {
assert.Len(t, list, 3)
assert.Len(t, list, 5)
Copy link
Member

Choose a reason for hiding this comment

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

Just checking why the change here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason of changing 3 to 5 was the actual and expected outcome was differing. Correct me if i am wrong in assert.Len() function we are passing length as gameserver with state in GameServerStateReady?

@@ -6,8 +6,7 @@ weight: 70
description: >
How to run multiple concurrent game sessions in a single GameServer process.
---
{{< beta title="Allocation State Filter" gate="StateAllocationFilter" >}}

{{% feature publishVersion="1.32.0" %}}
Copy link
Member

Choose a reason for hiding this comment

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

What we would want to do here instead is use feature expiryVersion to wrap the beta shortcode - since we want to remove it up until the next release.

The way it is currently would mean that as soon as we pushed this live, the whole block of docs would be removed.

@@ -10,7 +10,6 @@ description: >
{{< alpha
title="Player Tracking and Allocation Player Filter"
gate="PlayerTracking,PlayerAllocationFilter" >}}
{{< beta title="Allocation State Filter" gate="StateAllocationFilter" >}}
Copy link
Member

Choose a reason for hiding this comment

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

Same as above - need to wrap this in a feature shortcode to expire it on the next version, so it doesn't get removed immediately (docs get published immediately on merge to main).

@@ -36,8 +36,6 @@ spec:
game: my-game
matchExpressions:
- {key: tier, operator: In, values: [cache]}
# [Stage:Beta]
# [FeatureFlag:StateAllocationFilter]
Copy link
Member

Choose a reason for hiding this comment

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

All this will need to be feature code wrapped.

@ashutosji
Copy link
Contributor Author

I see a couple of failing tests - TestFindGameServerForAllocationPacked and TestFindGameServerForAllocationPacked/one_label in the unit tests.

Are they also failing for you locally? Are you able to reproduce the issues?

I see a couple of failing tests - TestFindGameServerForAllocationPacked and TestFindGameServerForAllocationPacked/one_label in the unit tests.

Are they also failing for you locally? Are you able to reproduce the issues?

Yeah, It's still passing!
Screenshot 2023-07-03 at 3 16 52 PM

@markmandel
Copy link
Member

Just touching base to see if you need a hand here. If not no worries, but figured I would check.

@Kalaiselvi84
Copy link
Contributor

Closing this PR now, and will handle this issue in a different PR - #3308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New features for Agones size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants