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

Fix for flaky e2e: TestUnhealthyGameServersWithoutFreePorts #1480

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions test/e2e/gameserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,21 @@ func TestUnhealthyGameServersWithoutFreePorts(t *testing.T) {
t.Parallel()
nodes, err := framework.KubeClient.CoreV1().Nodes().List(metav1.ListOptions{})
assert.Nil(t, err)

// gate
assert.True(t, len(nodes.Items) > 0)

gs := framework.DefaultGameServer(defaultNs)
gs.Spec.Ports[0].HostPort = 7515
// choose port out of the minport/maxport range
gs.Spec.Ports[0].HostPort = 5555
Copy link
Member

Choose a reason for hiding this comment

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

Also smart, no collisions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Added description of the root cause in original ticket. #1376 (comment)

gs.Spec.Ports[0].PortPolicy = agonesv1.Static

gameServers := framework.AgonesClient.AgonesV1().GameServers(defaultNs)

for range nodes.Items {
_, err := gameServers.Create(gs.DeepCopy())
assert.Nil(t, err)
for _, n := range nodes.Items {
// using only gameserver node pool with no taints
if len(n.Spec.Taints) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

ooooooooh! That makes sense. 🤦

_, err := framework.CreateGameServerAndWaitUntilReady(defaultNs, gs.DeepCopy())
assert.Nil(t, err)
}
}

newGs, err := gameServers.Create(gs.DeepCopy())
Expand Down