mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
fix: Test flake in TestWorkspaceStatus
(#4333)
This also changes the status to be on the workspace build, since that's where the true value is calculated. This exposed a bug where jobs could never enter the canceled state unless fetched by a provisioner daemon, which was nice to fix! See: https://github.com/coder/coder/actions/runs/3175304200/jobs/5173479506
This commit is contained in:
@ -2125,18 +2125,20 @@ const updateProvisionerJobWithCancelByID = `-- name: UpdateProvisionerJobWithCan
|
||||
UPDATE
|
||||
provisioner_jobs
|
||||
SET
|
||||
canceled_at = $2
|
||||
canceled_at = $2,
|
||||
completed_at = $3
|
||||
WHERE
|
||||
id = $1
|
||||
`
|
||||
|
||||
type UpdateProvisionerJobWithCancelByIDParams struct {
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
CanceledAt sql.NullTime `db:"canceled_at" json:"canceled_at"`
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
CanceledAt sql.NullTime `db:"canceled_at" json:"canceled_at"`
|
||||
CompletedAt sql.NullTime `db:"completed_at" json:"completed_at"`
|
||||
}
|
||||
|
||||
func (q *sqlQuerier) UpdateProvisionerJobWithCancelByID(ctx context.Context, arg UpdateProvisionerJobWithCancelByIDParams) error {
|
||||
_, err := q.db.ExecContext(ctx, updateProvisionerJobWithCancelByID, arg.ID, arg.CanceledAt)
|
||||
_, err := q.db.ExecContext(ctx, updateProvisionerJobWithCancelByID, arg.ID, arg.CanceledAt, arg.CompletedAt)
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user