Skip to content

fix: fix TestAcquireJob_LongPoll flake #18442

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

Merged
merged 1 commit into from
Jun 19, 2025
Merged

fix: fix TestAcquireJob_LongPoll flake #18442

merged 1 commit into from
Jun 19, 2025

Conversation

sreya
Copy link
Collaborator

@sreya sreya commented Jun 19, 2025

I'll be honest I'm not even really sure the point of this test but it was failing due to The intention appears to be to have the context expire due to the poll override as opposed to the context provided to AcquireJob

2025-06-16T15:01:54.0863251Z         	Error:      	Received unexpected error:
2025-06-16T15:01:54.0863554Z         	            	acquire job:
2025-06-16T15:01:54.0864230Z         	            	    github.com/coder/coder/v2/coderd/provisionerdserver.(*server).AcquireJob
2025-06-16T15:01:54.0865173Z         	            	        /home/runner/work/coder/coder/coderd/provisionerdserver/provisionerdserver.go:329
2025-06-16T15:01:54.0865683Z         	            	  - failed to acquire job:
2025-06-16T15:01:54.0866374Z         	            	    github.com/coder/coder/v2/coderd/provisionerdserver.(*Acquirer).AcquireJob
2025-06-16T15:01:54.0867262Z         	            	        /home/runner/work/coder/coder/coderd/provisionerdserver/acquirer.go:148
2025-06-16T15:01:54.0867819Z         	            	  - pq: canceling statement due to user request

fixes coder/internal#714

The test was using a 1 microsecond timeout which is too short for database
operations, causing intermittent failures with 'pq: canceling statement due
to user request'. Increased to 10ms to allow sufficient time for the query
while still testing the timeout behavior.
@sreya sreya requested a review from deansheather June 19, 2025 02:39
@sreya sreya requested review from mafredri and removed request for deansheather June 19, 2025 02:39
@sreya sreya enabled auto-merge (squash) June 19, 2025 02:42
@sreya sreya changed the title fix: increase TestAcquireJob_LongPoll timeout to prevent flakiness fix: fix TestAcquireJob_LongPoll flake Jun 19, 2025
@sreya sreya merged commit b0fa327 into main Jun 19, 2025
42 checks passed
@sreya sreya deleted the jon/fixlongpoll branch June 19, 2025 02:50
@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flake: TestAcquireJob_LongPoll
2 participants