Skip to content

Commit e52780f

Browse files
RulaKhaledclaude
andcommitted
test(cloudflare): Run the Think e2e suite serially with a 90s timeout
`getPlaywrightConfig` already defaults to `workers: 1` and a 30s timeout. The app overrode both, so five tests each driving a live OpenRouter turn ran in parallel under a cap meant for mocked models. That came from copying `cloudflare-vercelai-v7`, which mocks its model; the two apps that call a real provider, `cloudflare-mastra` and `node-flue`, keep the serial default and raise the timeout to 90s instead. Also corrects the comment above the first test, which still claimed the worker imports no Sentry API. That stopped being true when the manual-span test was added, and the worker now imports `startSpan` for exactly that. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 9796d9c commit e52780f

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎dev-packages/e2e-tests/test-applications/cloudflare-think/playwright.config.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ const config = getPlaywrightConfig(
1313
startCommand: `pnpm preview`,
1414
port: APP_PORT,
1515
},
16-
{
17-
workers: '100%',
18-
retries: 0,
19-
},
16+
// Each test drives a real OpenRouter tool-calling turn (up to two model calls) and then waits for
17+
// the spans to flush, which does not fit the default 30s timeout when the provider is slow. The
18+
// serial default from `getPlaywrightConfig` is kept: these turns share one worker and one event
19+
// proxy, so running them in parallel only makes traces harder to tell apart.
20+
{ timeout: 90_000 },
2021
);
2122

2223
export default config;

‎dev-packages/e2e-tests/test-applications/cloudflare-think/tests/think.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import { attr, isTurnOf, newAgentId, runAgentTurn, type StreamedSpan } from './u
55
const APP = 'cloudflare-think';
66

77
/**
8-
* The whole point of the app: the user's worker imports no Sentry API at all. `sentryCloudflareVitePlugin()`
8+
* The whole point of the app: nothing wires Sentry into Think by hand. `sentryCloudflareVitePlugin()`
99
* detects `class ThinkAgent extends Think` and wraps the export at build time, and the `ai` SDK publishes
10-
* the telemetry `vercelAIIntegration` consumes. Nothing here is Think-specific on the SDK side, so this
11-
* test is what would catch either half of that chain breaking.
10+
* the telemetry `vercelAIIntegration` consumes. The worker's only Sentry import is the `startSpan` the
11+
* manual-span test below needs. Nothing here is Think-specific on the SDK side, so this test is what
12+
* would catch either half of that chain breaking.
1213
*
1314
* `collectStreamedSpans` rather than `waitForStreamedSpans`: the streamed `invoke_agent` parent stays
1415
* open until its children settle and flushes in a separate envelope from them, so a single envelope

0 commit comments

Comments
 (0)