Skip to content

Commit b0fa327

Browse files
authored
fix: increase TestAcquireJob_LongPoll timeout to prevent flakiness (#18442)
I'll be honest I'm not even really sure the point of this test but it was failing due to ``` 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 ``` which is certainly unintended.
1 parent 04d202a commit b0fa327

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

coderd/provisionerdserver/provisionerdserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ func (s *server) AcquireJob(ctx context.Context, _ *proto.Empty) (*proto.Acquire
321321
acqCtx, acqCancel := context.WithTimeout(ctx, s.acquireJobLongPollDur)
322322
defer acqCancel()
323323
job, err := s.Acquirer.AcquireJob(acqCtx, s.OrganizationID, s.ID, s.Provisioners, s.Tags)
324-
if xerrors.Is(err, context.DeadlineExceeded) {
324+
if database.IsQueryCanceledError(err) {
325325
s.Logger.Debug(ctx, "successful cancel")
326326
return &proto.AcquiredJob{}, nil
327327
}

0 commit comments

Comments
 (0)