Investigate deadlock #178

Merged
schmelczer merged 4 commits from asch/fix-tests into main 2025-12-05 22:34:14 +00:00
2 changed files with 7 additions and 14 deletions
Showing only changes of commit a5e128efcd - Show all commits

View file

@ -199,14 +199,14 @@ export class MockAgent extends MockClient {
);
this.client.logger.info(
"Local files: " +
Array.from(otherAgent.localFiles.keys()).join(", ")
Array.from(otherAgent.localFiles.keys()).join(", ")
);
otherAgent.client.logger.info(
"Local data: " + JSON.stringify(otherAgent.data, null, 2)
);
otherAgent.client.logger.info(
"Local files: " +
Array.from(otherAgent.localFiles.keys()).join(", ")
Array.from(otherAgent.localFiles.keys()).join(", ")
);
throw e;

View file

@ -1,4 +1,3 @@
export async function withTimeout<T>(
promise: Promise<T>,
timeoutMs: number,
@ -7,17 +6,11 @@ export async function withTimeout<T>(
return Promise.race([
promise,
new Promise<T>((_, reject) =>
setTimeout(
() =>
{ reject(
new Error(
`${operationName} timed out after ${timeoutMs}ms`
)
); },
timeoutMs
)
setTimeout(() => {
reject(
new Error(`${operationName} timed out after ${timeoutMs}ms`)
);
}, timeoutMs)
)
]);
}