Skip to content

test(coderd/database): use subtest context in TestProjectSkillQueries - #31011

Merged
jaaydenh merged 1 commit into
mainfrom
codagt-1424-project-skill-queries-flake
Oct 19, 2026
Merged

jaaydenh merged 1 commit into
mainfrom
codagt-1424-project-skill-queries-flake

Conversation

@jaaydenh

Copy link
Copy Markdown
Collaborator

TestProjectSkillQueries crashed the whole coderd/database package on macOS and Windows in nightly-gauntlet (run) with panic: test executed panic(nil) or runtime.Goexit.

Its parallel subtests used the parent's WaitLong context and called require.NoError on the parent *testing.T through the as helper. Parallel subtests only start after the parent returns and a -parallel slot frees up, so on slow runners the shared deadline had already expired (get authorization user roles: context deadline exceeded). Calling FailNow on the parent from a child goroutine then panicked and aborted the package, leaving hundreds of (unknown) failures.

as now takes the caller's t and ctx, and each subtest creates its own context after t.Parallel().

Fixes CODAGT-1424

The parallel subtests used the parent test's WaitLong context and called
require.NoError on the parent *testing.T through the as helper. Parallel
subtests only start after the parent returns and a parallel slot frees
up, so on slow runners the shared deadline had already expired. The
resulting FailNow on the parent from a child goroutine panicked and
aborted the whole coderd/database package.

Pass the caller's t and ctx into as, and give each subtest its own
context created after t.Parallel().

Fixes CODAGT-1424
@jaaydenh

Copy link
Copy Markdown
Collaborator Author

@codex review

@linear-code

linear-code Bot commented Oct 19, 2026

Copy link
Copy Markdown

CODAGT-1424

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T08:40:42.096913Z 4c88f07 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 4c88f0702f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jaaydenh
jaaydenh marked this pull request as ready for review October 19, 2026 08:50
@jaaydenh
jaaydenh merged commit 452654d into main Oct 19, 2026
57 of 58 checks passed
@jaaydenh
jaaydenh deleted the codagt-1424-project-skill-queries-flake branch October 19, 2026 11:05
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 19, 2026
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.

2 participants