Skip to content

test: fix flaky TestPortRangeAllocatorSyncDeleteGameServer#4399

Merged
markmandel merged 2 commits intoagones-dev:mainfrom
markmandel:flaky/TestPortRangeAllocatorSyncDeleteGameServer
Dec 27, 2025
Merged

test: fix flaky TestPortRangeAllocatorSyncDeleteGameServer#4399
markmandel merged 2 commits intoagones-dev:mainfrom
markmandel:flaky/TestPortRangeAllocatorSyncDeleteGameServer

Conversation

@markmandel
Copy link
Copy Markdown
Collaborator

@markmandel markmandel commented Dec 26, 2025

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:

Fixing the race condition that an event may not have fired even though Agones client list operations may be returning the correct list values.

Utilised Eventually and Never to ensure we tested for eventual final states, as well as making some small test improvements along the way.

Which issue(s) this PR fixes:

Closes #4390

Special notes for your reviewer:

I ran this 200 times with no issues.

@Sivasankaran25 PTAL - I couldn't see any race conditions that would cause the failures we were seeing in your PR, but I dug into the issue, and this is where I landed. Lemme know if I missed anything though!

Fixing the race condition that an event may not have fired even though
Agones client list operations may be returning the correct list values.

Utilised `Eventually` and `Never` to ensure we tested for eventual
final states.

Closes agones-dev#4390
@markmandel markmandel added the area/tests Unit tests, e2e tests, anything to make sure things don't break label Dec 26, 2025
@github-actions github-actions bot added kind/cleanup Refactoring code, fixing up documentation, etc size/S labels Dec 26, 2025
@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 02ff7fd2-3273-4e7b-bb27-a9af1c5d6cf3

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/4399/head:pr_4399 && git checkout pr_4399
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.55.0-dev-d9a974a

Copy link
Copy Markdown
Collaborator

@lacroixthomas lacroixthomas left a comment

Choose a reason for hiding this comment

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

LGTM

@markmandel markmandel enabled auto-merge (squash) December 27, 2025 17:09
@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: 48359fc9-574f-43ba-a29c-541461d6652e

Status: FAILURE

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

@markmandel
Copy link
Copy Markdown
Collaborator Author

New flake?

time="2025-12-27T17:22:10Z" level=error msg="Timeout waiting for processor response" requestID=8b5a5058-05fb-4bb8-b019-cf3e31c770b1
--- FAIL: TestProcessorClient_Allocate (0.25s)
    --- FAIL: TestProcessorClient_Allocate/successful_allocation_with_batchSize_3 (0.09s)
        client_test.go:216: expected no error for request 0, got rpc error: code = DeadlineExceeded desc = allocation timeout after 50ms
        client_test.go:219: expected response for request 0, got nil
time="2025-12-27T17:22:11Z" level=info msg="Pull request handler stopping"
FAIL
FAIL	agones.dev/agones/pkg/processor	0.459s
?   	agones.dev/agones/pkg/sdk	[no test files]

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: 5a4a6153-eb0e-4106-8534-9ddc1153cc57

Status: FAILURE

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

@lacroixthomas
Copy link
Copy Markdown
Collaborator

Seen that yesterday locally, I have set a timeout way too short, like 50ms 😅

@markmandel
Copy link
Copy Markdown
Collaborator Author

Doh. TestControllerGameServersNodeState. I have a fix for this one locally, I need to do a quick review for it and get it up.

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 4131bddb-e066-437d-bc6f-ca56fac6a5b8

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/4399/head:pr_4399 && git checkout pr_4399
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.55.0-dev-0b4f29f

@markmandel markmandel merged commit 30ef258 into agones-dev:main Dec 27, 2025
4 checks passed
@markmandel markmandel deleted the flaky/TestPortRangeAllocatorSyncDeleteGameServer branch December 27, 2025 19:57
mnthe pushed a commit to mnthe/agones that referenced this pull request Mar 23, 2026
…v#4399)

Fixing the race condition that an event may not have fired even though
Agones client list operations may be returning the correct list values.

Utilised `Eventually` and `Never` to ensure we tested for eventual
final states.

Closes agones-dev#4390
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Flaky Unit Test: TestPortRangeAllocatorSyncDeleteGameServer

3 participants