Repository navigation
test(workflow): give the eight flaky workflow cases a budget that fits their real work (#1504) - #1522
Conversation
No findings in the eight timeout changes. The description records type-check and lint results; these test-budget changes require no real-CLI verification record. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
@Walternater Thanks for taking Part 1 of #1504. The comments say what each test waits for, which is what the issue asks for when a timeout is raised. Two things before we can approve:
-
[P1 blocking] The
node_modulessymlink is committed again. It points to/Users/wcf/IdeaProjects/teamai-cli-pr1513/node_modules, like the one #1521 had. Checking out this branch over an existing install deletes the localnode_modules/, because.gitignore'snode_modules/doesn't match a symlink.git rm --cached node_modulesremoves it. -
[P2 non-blocking, but it fits this PR] Four rows of the #1504 table failed on assertions, not on the 15 s budget. The body says every case fails on the budget and that your repro under load shows timeouts. In CI, though, these four failed differently:
workflow-workspace.test.ts, "does not publish an agent conflict a prompt left untouched": an assertion at :1787.- The same file, "does not publish conflict markers a prompt left in an agent file":
expected undefined to match object { code: 'merge_conflict' }at :2252. - The same file, "keeps a modify/delete resolution a prompt staged without editing the file": an assertion at :2452.
workflow-skill-driver.test.ts, "stops the setup a killed runner left running":expected true to be falseat :891.
A larger test budget doesn't change an assertion that fails before the budget runs out. That could still be load if something inside these tests has its own deadline (a lock, a poll, a grace period) that gives up and returns early. Can you point to that deadline for each? Or show the four rows passing 20 runs in a row under the same load, which is the issue's other way to close a row? If one of them is a real race, the issue asks for its own issue.
The other four rows (workflow-handoff, the two workflow-local-driver SIGTERM cases, workflow-skill-lock) failed on the 15 s budget, and the comments say what each one waits on. Those look right to us.
1e6fe83 to
4588a2a
Compare
|
No new findings in the specified diff.
No PR code was run, built, or installed. |
@Walternater Thanks. The symlink is gone. Splitting the two skill-driver cases into #1523 makes sense, and the three One point is still open for the three // workflow-workspace.test.ts:1783-1787 on main
expect(done).toMatchObject({ data: { done: { outcome: 'failed' } } }); // passed
const join = run.steps.find((step) => step.id === 'join');
expect(join && 'failure' in join ? join.failure : undefined)
.toMatchObject({ code: 'merge_conflict' }); // got undefinedSo the run failed for some other reason inside the 15 s. Most likely Two ways forward:
The rest is ready to approve once that is settled. |
…that fits their real work (Tencent#1504) Three of the eight cases in the table of Tencent#1504 fail the same way: the default 15 s budget, not a wrong answer. Each waits on real work — two git worktrees in parallel, a child process that ignores SIGTERM and is killed after a grace period, or a member's copy fetched from another machine. On an idle runner they take 1-3 s; on a loaded one, tens of seconds. Each gets a budget that fits, and a comment that says what it waits for. The three workflow-workspace cases are left out: in CI they end early with a wrong outcome, which no budget fixes (see the issue filed for them).
4588a2a to
3c66289
Compare
|
@SaulMoro The three The failing run is the shortest of the three, not the longest. From the reporter of CI run 40601406383 (macOS Node 22, an unrelated PR), the same file, minutes apart: 684 ms against 1445 ms and 1581 ms. The run ended early because a step failed, not because it ran out of time: So they are a race, and #1504's definition of done says a real race gets its own issue. That is #1526: #1526 What I could not do is name the failing step — the test asserts on What is left in this PR is the three rows that do wait on real work, each with a comment saying what it waits for:
Those three fail on the 15 s budget in CI as well — run 40683380254 (macOS Node 22) logged One thing worth knowing about the same run: it also failed two rows that are not in #1504's table, with the same 15 s budget — The |
|
No new findings in the specified diff.
No PR code was run, built, or installed. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
@Walternater Thanks, approving 3c662892, and thanks for running the workspace cases down.
- What's left. The three rows left here fail on the 15 s budget in CI, and each waits on real work: a second machine's worktree and claim, or a child that ignores
SIGTERMuntil the grace period kills it. Each comment says which. That is the case #1504 allows a raised timeout for. - The workspace cases. Your reporter timings settle it: the failing case ended in 684 ms, so the run failed early and no budget would change it. Moving those three to #1526, starting with an assertion message that names the failed step, is the right next step.
- Housekeeping. The
node_modulessymlink is gone, and the diff touches only the two test files. It merges cleanly with current main, and CI is green at this head.
The other rows you saw hit 15 s in the same run belong on #1504, as you noted there.
…dget that fits it (Tencent#1522) Part of Tencent#1504: the workflow-handoff case that continues a copy taken back from another machine, and the two workflow-local-driver cases that kill a command or descendant ignoring SIGTERM, get a 120 s budget with a comment saying what each waits on. The three workflow-workspace cases from Tencent#1504 are a race, tracked in Tencent#1526.
Summary
Part 1 of #1504: the three of the eight workflow cases that flake on a loaded macOS runner because of the default 15 s budget get a budget that fits the real work they wait for.
The other five cases in the issue's table are not a budget problem and are filed elsewhere:
workflow-workspace.test.tsend early with a wrong outcome (the failing run is the shortest of the three, 684 ms against 1445 ms and 1581 ms for the passing neighbours) — [test] Three workflow-workspace cases end early with a wrong outcome instead of timing out #1526What changed
Only timeouts, and a comment each saying what the test waits for:
workflow-handoff.test.tsworkflow-local-driver.test.tsworkflow-local-driver.test.tsNo product code changes, and no test logic changes: a test that fails for a reason other than the budget still fails.
Evidence
Each of the three fails on the default 15 s budget, not on a wrong answer. It waits on real work — a git worktree added and pushed, two of them in parallel, a member's copy fetched from another machine, or a child process that ignores
SIGTERMand is killed after a five-second grace period. On an idle runner they take 1–3 s; on a loaded one they take tens of seconds.The failure reproduces locally as a timeout:
The same shape for the others:
Test timed out in 15000ms, with the case itself taking 70 s under that load (Duration 107.15s, of which 70.18 s the test). With the budget raised, the same six-at-once load passes.In CI these three fail the same way: run 40683380254 (macOS Node 22) logged
Error: Test timed out in 15000msfor the twoworkflow-local-driverrows and for theworkflow-handoffrow.Tests
npx tsc --noEmit— passes.npm run lint— 0 warnings, 0 errors.No real-CLI record: the diff changes test budgets only, not what the CLI does.
Notes for reviewers