Skip to content

test(server): the webhook issue-thread test waits for the event to name its thread - #956

Merged
badcuban merged 1 commit into
mainfrom
fix-webhook-events-flake
Nov 16, 2026
Merged

badcuban merged 1 commit into
mainfrom
fix-webhook-events-flake

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

WebhookEvents.test.ts "two events for a new issue share one thread: the second waits for the first's thread" failed now and then with expected null to equal <thread id>. It knocked the 0.10.1 notes out of the merge queue once.

Why

An event reads joined as soon as its run is claimed (claimEventRun sets the status in the same transaction that inserts the run, which is still launching). The thread it lists comes from the run's thread_id, which is set a step later, once the run reaches the thread. The test waited for joined and then read the thread at once, so on a busy runner it read null. In the app the thread link just shows up a moment after the status; users aren't affected.

Fix

The test waits until the event is joined and names a thread, then checks it's the issue's thread.

Checked

  • Old test under load (6 copies at once, twice): failed 2 of 12, with CI's error.
  • New test under the same load: 18 of 18 pass.
  • The whole file passes (27 tests). vp fmt and vp lint pass.

…me its thread

An event reads "joined" once its run is claimed, and names its thread (the run's thread_id) once the run reaches the thread, a step later. The test waited for "joined" and then read the thread at once, so on a busy runner it read null. It now waits for both. Under load the old test failed 2 of 12 runs with CI's error; the new one passed 18 of 18.
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 16, 2026 10:59am UTC

Request Review

@badcuban
badcuban enabled auto-merge November 16, 2026 10:59
@badcuban
badcuban added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit c21fd38 Nov 16, 2026
24 checks passed
@badcuban
badcuban deleted the fix-webhook-events-flake branch November 16, 2026 11:11

This branch was previously deployed

1 inactive deployment
Preview — b03eb7ed Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant