fix(cdp): wait on the resolver job row, not the mock counter - #95850
Draft
posthog[bot] wants to merge 1 commit into
Draft
fix(cdp): wait on the resolver job row, not the mock counter#95850posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
Two batch resolver e2e cases polled a counter that the mocked fetch bumps when the request starts, then read cyclotron_jobs once. The reschedule reaches Postgres after that, so the status read could still see 'running'. Move the row read inside waitForExpect in both cases. Add an attempts assertion to the audience fetch case, because the job also starts out available. Generated-By: PostHog Desktop Task-Id: c071f9b1-4feb-4834-a6f4-fb65da280a89
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Contributor
Author
Contributor
🤖 CI report✅ Trunk lane — non-backend laneThis PR is assigned to the non-backend lane. It does not run backend Python tests and may merge in parallel with PRs in other lanes. |
There was a problem hiding this comment.
Approved.
Test-only change to a serial e2e spec that fixes a real race by waiting on the DB row instead of a mock counter; diff matches the description exactly and carries no production or infra risk.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 0L, 0F substantive, 73L/1F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T0 auto-approve: T0-deterministic (73L, 1F, single-area, fix) |
| stamphog 2.0.0b4 | .stamphog/policy.yml @ 7fbf176 · reviewed head 7fbf176 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Node.js serial Tests 3/3shard get a red build from a racing assertion, three times in the last week. Each hit blocks a merge and costs a rerun of the shard.fetchAttempts, a counter the mocked audience fetch increments when the fetch starts.status = 'available'later, after its catch block callsjob.rescheduleand the worker flushes to Postgres.running. The other assertions in the case hold either way, so exactly one line flakes.putAttemptsthe same way. It is a latent second instance.Changes
waitForExpect.state.attempts >= 1. Without it the poll could pass on the job's initial row, which is alreadyavailablewith a null cursor and zero counters.How did you test this code?
Local run command
Automatic notifications
Docs update
None. The change touches no user-facing behavior.
🤖 Agent context
Autonomy: Fully autonomous
/writing-pr-descriptions,/simplify,/writing-simplified-technical-english.gh pr list --state open --search "workflows-e2e serial flaky resolver"found nothing that fixes this.state.attemptsassertion was not in the report's plan. Moving the read alone would have let the audience fetch case pass on the job's initial row, which already matches every assertion in it./simplifyfound nothing to cut. The duplicatedcyclotron_jobsquery matches two sibling cases in the same file, so no helper was extracted.Created with PostHog Desktop from this inbox report.