Problem
In packages/client-typescript/tests/RocketRideClient.test.ts and packages/client-typescript/tests/deploy.test.ts, the afterEach teardown uses a timeout promise that resolves after 10 s:
await Promise.race([
client.disconnect(),
new Promise<void>((resolve) => setTimeout(resolve, 10000)),
]);
Because the timeout branch resolves (rather than rejects), afterEach returns successfully even when client.disconnect() never settles. This masks teardown hangs and can leave pending work that leaks into subsequent tests.
Suggested fix
Change the timeout promise to reject so that the test fails fast when a hang occurs:
await Promise.race([
client.disconnect(),
new Promise<never>((_, reject) =>
setTimeout(() => reject(new Error('client.disconnect() timed out after 10s')), 10000),
),
]);
Apply the fix to both affected files:
packages/client-typescript/tests/RocketRideClient.test.ts
packages/client-typescript/tests/deploy.test.ts
Context
Identified during review of PR #805 (comment: #805 (comment)).
Requested by @stepmikhaylov.
Problem
In
packages/client-typescript/tests/RocketRideClient.test.tsandpackages/client-typescript/tests/deploy.test.ts, theafterEachteardown uses a timeout promise that resolves after 10 s:Because the timeout branch resolves (rather than rejects),
afterEachreturns successfully even whenclient.disconnect()never settles. This masks teardown hangs and can leave pending work that leaks into subsequent tests.Suggested fix
Change the timeout promise to reject so that the test fails fast when a hang occurs:
Apply the fix to both affected files:
packages/client-typescript/tests/RocketRideClient.test.tspackages/client-typescript/tests/deploy.test.tsContext
Identified during review of PR #805 (comment: #805 (comment)).
Requested by @stepmikhaylov.