Skip to content

Commit c7ddc09

Browse files
Give the Telegram fixture roots per-process paths
Two concurrent invocations of the backend suite on one checkout raced on the fixed .tmp fixture directories: the second run's beforeEach wiped the directory while the first run's test was mid-flight, surfacing as a spurious ENOENT on bounded-provider.ogg in the Telegram bounding test (passed in isolation, failed ~once per full-suite run when runs overlapped). Suffix both roots with the process pid so each suite owns its fixtures; the after-hook still removes them.
1 parent e8b6623 commit c7ddc09

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

backend/tests/telegram-conversational.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ import { conversationalRolloutSnapshot } from '../src/conversation/rollout';
4444
import type { LambdaEvent } from '../src/types';
4545

4646
const NOW = new Date('2026-07-30T12:00:00.000Z');
47-
const ROOT = path.resolve('..', '.tmp', 'telegram-conversational-tests');
47+
// The pid suffix keeps concurrent suite invocations of this checkout from
48+
// racing on one fixture directory: another process's beforeEach wipes ROOT,
49+
// which surfaced as a spurious ENOENT on the voice fixture mid-test.
50+
const ROOT = path.resolve('..', '.tmp', `telegram-conversational-tests-${process.pid}`);
4851

4952
function apiEvent(
5053
method: string,

backend/tests/todo-media-composed.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ import type { LambdaEvent } from '../src/types';
5656
const NOW = new Date('2026-07-30T12:00:00.000Z');
5757
const ACTOR_ID = 'actor-media-composed';
5858
const CHAT_ID = '9201';
59-
const ROOT = path.resolve('..', '.tmp', 'todo-media-composed');
59+
// Pid suffix: see telegram-conversational.test.ts — concurrent suite runs
60+
// must not share one fixture directory.
61+
const ROOT = path.resolve('..', '.tmp', `todo-media-composed-${process.pid}`);
6062

6163
function validOgg(): Buffer {
6264
const body = Buffer.concat([Buffer.from('OpusHead'), Buffer.alloc(11)]);

0 commit comments

Comments
 (0)