Skip to content

Commit 8d76bda

Browse files
authored
fix(init): extend API timeout to 210 seconds (#1252)
## Summary Extends the Sentry Init Mastra API timeout from 180 seconds to 210 seconds. A recent Next.js run completed the server-side Plan code changes step in 192.97 seconds, but the CLI crossed its 180-second deadline before the result arrived. The additional 30 seconds covers that observed case while the underlying Docs MCP latency is tracked separately in getsentry/cli-init-api#199. The recovery test now proves the exact boundary: recovery has not started at 209,999 ms and starts after the final millisecond. ## Test plan - `pnpm exec vitest run test/lib/init/wizard-runner.test.ts` — 56 tests pass - `pnpm run lint` — 917 files pass - `pnpm run generate:schema && pnpm run typecheck` — passes - `git diff --check` — passes
1 parent 48f5e63 commit 8d76bda

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/lib/init/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const SENTRY_DOCS_URL = "https://docs.sentry.io/platforms/";
1111
export const MAX_FILE_BYTES = 262_144; // 256KB per file
1212
export const MAX_OUTPUT_BYTES = 65_536; // 64KB stdout/stderr truncation
1313
export const DEFAULT_COMMAND_TIMEOUT_MS = 120_000; // 2 minutes
14-
export const API_TIMEOUT_MS = 180_000; // 3 minutes timeout for Mastra API calls
14+
export const API_TIMEOUT_MS = 210_000; // 3.5 minutes timeout for Mastra API calls
1515

1616
// Exit codes returned by the remote workflow.
1717
// These are internal to the workflow protocol — they're mapped to EXIT.*

test/lib/init/wizard-runner.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,10 @@ describe("runWizard — resumeWithRetry stale-step recovery", () => {
12751275
});
12761276

12771277
const run = runWizard(makeOptions());
1278-
await vi.advanceTimersByTimeAsync(180_000);
1278+
await vi.advanceTimersByTimeAsync(209_999);
1279+
expect(runByIdMock).not.toHaveBeenCalled();
1280+
1281+
await vi.advanceTimersByTimeAsync(1);
12791282
await run;
12801283

12811284
expect(formatResultSpy).toHaveBeenCalled();

0 commit comments

Comments
 (0)