Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

flake: TestTasksCreate (multiple variants)

オープン 初心者向け
#1,637 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
go
領域
testing

調査の方向性

coderd/aitasks_test.go の TestTasksCreate から始め、特に 1719-2130 行付近の setup と CreateTask 呼び出しを確認してください。go test ./coderd -run '^TestTasksCreate$' -count=100 を、できれば Windows 上または contention を追加した状態で実行し、既存の assertions が引き続き pass したまま、すべての variant が context deadline failures なしで完了することを確認してください。

索引モデルが issue の本文から書いたものです。

説明

flake

CI failure

The complete 4,462-line Windows job log was available and reviewed. The macOS matrix job was canceled only after this Windows job failed; this is not a matrix-cancellation artifact.

Failure evidence

Seven TestTasksCreate variants failed at the same API call with the same expired request context:

=== FAIL: coderd TestTasksCreate/TaskTableCreatedAndLinked (17.07s)
aitasks_test.go:1968:
    Post "http://127.0.0.1:52750/api/v2/tasks/me": context deadline exceeded

=== FAIL: coderd TestTasksCreate/OK (17.13s)
aitasks_test.go:1751:
    Post "http://127.0.0.1:52230/api/v2/tasks/me": context deadline exceeded

=== FAIL: coderd TestTasksCreate/MultipleTasksForSameUser (17.08s)
aitasks_test.go:2060:
    Post "http://127.0.0.1:52756/api/v2/tasks/me": context deadline exceeded

=== FAIL: coderd TestTasksCreate/FailsOnInvalidTemplate (17.07s)
aitasks_test.go:1936:
    expected: *codersdk.Error
    in chain: Post "http://127.0.0.1:52831/api/v2/tasks/me": context deadline exceeded

=== FAIL: coderd TestTasksCreate/TaskWithCustomName (17.08s)
aitasks_test.go:2026:
    Post "http://127.0.0.1:52697/api/v2/tasks/me": context deadline exceeded

=== FAIL: coderd TestTasksCreate/TaskLinkedToCorrectTemplateVersion (17.13s)
aitasks_test.go:2122:
    Post "http://127.0.0.1:52747/api/v2/tasks/me": context deadline exceeded

=== FAIL: coderd TestTasksCreate/FailsOnNonTaskTemplate (17.26s)
aitasks_test.go:1906:
    expected: *codersdk.Error
    in chain: Post "http://127.0.0.1:52830/api/v2/tasks/me": context deadline exceeded

All template-version build jobs completed successfully immediately before the failing CreateTask requests. This is one synchronized test-family timeout, not seven independent product failures.

Root cause assessment

Classification: flaky test / timing-dependent deadline exhaustion on Windows.

Each failing subtest creates a 10-second context at the beginning of the test body:

ctx := testutil.Context(t, testutil.WaitShort) // WaitShort = 10s

It then performs expensive setup with that deadline already ticking:

  1. starts an in-process coderd and provisioner daemon;
  2. creates/logs in the first user;
  3. uploads a template version;
  4. waits for the provisioner import job;
  5. creates a template;
  6. only then calls client.CreateTask(ctx, ...).

Under full-suite Windows load, setup consumed essentially the entire 10-second budget. The seven parallel variants consequently reached POST /api/v2/tasks/me with expired or nearly expired contexts and failed together after roughly 17.1 seconds of reported subtest time. Server logs show setup and template imports succeeding; there is no database outage or product panic.

A deterministic fix is to create a fresh request context immediately before CreateTask (and fresh contexts for later assertions), or use WaitLong for end-to-end variants whose setup is intentionally included in the deadline. The context should not be started before server/template setup.

Race, panic, OOM, and resource checks

The full job log contains no WARNING: DATA RACE, race detected during execution of test, panic/runtime-error trace, OOM, killed process, allocation failure, disk exhaustion, or file-descriptor exhaustion indicator. This was a normal assertion failure, not a process crash.

Assignment analysis

Ownership/history targets:

git blame -L 1719,2130 coderd/aitasks_test.go
git log --oneline -10 --follow coderd/aitasks_test.go

The most recent non-trivial modifier of TestTasksCreate itself is 30112075 (feat: add display name field for tasks, PR coder/coder#20856) by ssncferreira. That change substantially expanded the CustomNames portion of this exact function and retained the same early WaitShort context pattern. Later file changes either modify separate task tests or unrelated areas.

Assigning ssncferreira based on the failing test-function history, not the author of the CI commit.

Duplicate search

Searched open and closed coder/internal issues, including issues closed in the last 30 days, for:

  • TestTasksCreate, TasksCreate, and individual failing variants;
  • api/v2/tasks/me + context deadline exceeded;
  • aitasks_test.go, Windows task timeouts, and WaitShort;
  • database/timing errors, process crashes, panic/OOM/unknown failures, and race signatures.

No issue describes this exact test family and deadline-exhaustion mode.

Related but not duplicate:

Reproduction

Most likely on Windows under full-suite parallel load:

go test ./coderd -run '^TestTasksCreate$' -count=100

To amplify locally, add delay or CPU/DB contention before CreateTask; the current context begins before all server and template setup.

主要言語
言語のデータがありません
スター
3
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

coder/internal のほかの issue

coder/internal の issue をすべて見る

似ている issue

Testing & QA の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。