device-oauth-performance.test.mjs
32 lines 1.1 KB
Raw
sha256:c2dbf04d56308f3bbf2d06e6d2eb022b8948b1e827195fe525a44e5e18d5f9c0 feat(auth): Phase B Connect cloud agent (RFC 8628) + Hermes… Human minor ⚠ breaking 11 days ago
1 /**
2 * Phase B — device OAuth: performance tier (light).
3 *
4 * Bulk device authorization creation completes within a reasonable wall-clock
5 * budget on a temp data directory.
6 */
7
8 import { describe, it, afterEach } from 'node:test';
9 import assert from 'node:assert/strict';
10 import { createDeviceAuthorization } from '../hub/gateway/device-oauth-store.mjs';
11 import { createTempStrongStore } from './helpers/device-oauth-harness.mjs';
12
13 const cleanups = [];
14 afterEach(async () => {
15 while (cleanups.length) await cleanups.pop()();
16 });
17
18 describe('Phase B performance — bulk authorization create', () => {
19 it('50 createDeviceAuthorization calls complete under 5 seconds', async () => {
20 const tmp = await createTempStrongStore();
21 cleanups.push(tmp.cleanup);
22
23 const start = Date.now();
24 for (let i = 0; i < 50; i++) {
25 const created = await createDeviceAuthorization({ clientId: `perf-${i}` });
26 assert.ok(created.deviceCode);
27 assert.ok(created.userCode);
28 }
29 const elapsed = Date.now() - start;
30 assert.ok(elapsed < 5000, `50 creates took ${elapsed}ms (budget 5000ms)`);
31 });
32 });
File History 1 commit
sha256:93bcf8f9bd56d8c5b9339f4ec73b9ebd66571398d56262d38eedc2cfa9db9882 fix(test): align Band B landing assertion with desktop MCP … Human 11 days ago