Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit49ff86f

Browse files
blink-so[bot]sreya
andcommitted
fix: handle postgres query cancellation in TestAcquireJobWithCancel_Cancel
The test was failing because it was checking for context.Canceled usingxerrors.Is, but postgres returns a different error ("pq: cancelingstatement due to user request") when a query is cancelled. This changeuses database.IsQueryCanceledError which properly handles bothcontext.Canceled and postgres-specific cancellation errors.Co-authored-by: sreya <4856196+sreya@users.noreply.github.com>
1 parent04d202a commit49ff86f

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
@@ -368,7 +368,7 @@ func (s *server) AcquireJobWithCancel(stream proto.DRPCProvisionerDaemon_Acquire
368368
je=<-jec
369369
caseje=<-jec:
370370
}
371-
ifxerrors.Is(je.err,context.Canceled) {
371+
ifdatabase.IsQueryCanceledError(je.err) {
372372
s.Logger.Debug(streamCtx,"successful cancel")
373373
err:=stream.Send(&proto.AcquiredJob{})
374374
iferr!=nil {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp