n8n/packages/testing/playwright/tests/infrastructure/benchmarks/webhook/webhook-single-instance.spec.ts
Declan Carroll 7bd7b9943b
test(benchmark): Add dedicated webhook procs + sizing matrix aggregator (DEVP-200 + DEVP-185) (#31037)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-03 10:49:17 +00:00

53 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { test } from '../../../../fixtures/base';
import { benchConfig } from '../../../../playwright-projects';
import { setupWebhook } from '../../../../utils/benchmark/webhook-driver';
import { runWebhookThroughputTest } from '../harness/webhook-throughput-harness';
const CONNECTIONS = 250;
const DURATION_SECONDS = 120;
// Direct mode: no Bull, no workers. Webhook receives → workflow runs inline on
// the same Node.js process → respond. Async (`onReceived`) returns the 200
// before execution completes; the workflow runs as a detached promise on the
// same event loop. This is the canonical single-instance direct-mode ceiling
// — the community-edition / single-container deployment shape. For queue-mode
// shapes, see the `webhook-dedicated-proc-*` specs.
test.use({ capability: benchConfig('webhook-single-instance') });
test.describe(
'What is the single-instance webhook ingestion ceiling?',
{
tag: '@bench:webhook',
annotation: [
{ type: 'owner', description: 'Catalysts' },
{ type: 'question', description: 'webhook-single-instance' },
],
},
() => {
test(`Async webhook + 1 noop, 1KB payload, ${CONNECTIONS} connections × ${DURATION_SECONDS}s (1 main, no workers)`, async ({
api,
services,
backendUrl,
}, testInfo) => {
const handle = setupWebhook({
scenario: {
nodeCount: 1,
payloadSize: '1KB',
nodeOutputSize: 'noop',
responseMode: 'onReceived',
},
});
await runWebhookThroughputTest({
handle,
api,
services,
testInfo,
baseUrl: backendUrl,
connections: CONNECTIONS,
durationSeconds: DURATION_SECONDS,
timeoutMs: (DURATION_SECONDS + 60) * 1000,
});
});
},
);