Use locks

This commit is contained in:
Andras Schmelczer 2026-01-22 20:21:30 +00:00
parent 4fb4b498a1
commit 727b6b7ed5
10 changed files with 245 additions and 317 deletions

View file

@ -9,7 +9,7 @@ import { sleep } from "../utils/sleep";
import type { LogLine } from "sync-client";
import { withTimeout } from "../utils/with-timeout";
const TIMEOUT_MS = 10 * 60 * 1000;
const TIMEOUT_MS = 2 * 60 * 1000;
export class MockAgent extends MockClient {
private readonly writtenContents: string[] = [];
@ -105,7 +105,16 @@ export class MockAgent extends MockClient {
}
public async waitUntilSynced(): Promise<void> {
await this.client.waitUntilFinished();
await withTimeout(
(async (): Promise<void> => {
this.client.setSetting("isSyncEnabled", true);
await this.client.waitUntilFinished();
})(),
TIMEOUT_MS,
"waitUntilSynced()"
);
}
public async act(): Promise<void> {