diff --git a/frontend/sync-client/src/sync-client.ts b/frontend/sync-client/src/sync-client.ts index 2338808f..ba9f9d70 100644 --- a/frontend/sync-client/src/sync-client.ts +++ b/frontend/sync-client/src/sync-client.ts @@ -141,6 +141,7 @@ export class SyncClient { /// and the local database but retain the settings. /// The SyncClient can be used again after calling this method. public async reset(): Promise { + this.stop(); await this._syncer.reset(); this._history.reset(); await this._database.resetSyncState(); diff --git a/frontend/test-client/src/agent/mock-agent.ts b/frontend/test-client/src/agent/mock-agent.ts index 53bc0306..3bc1da03 100644 --- a/frontend/test-client/src/agent/mock-agent.ts +++ b/frontend/test-client/src/agent/mock-agent.ts @@ -31,7 +31,8 @@ export class MockAgent extends MockClient { switch (message.level) { case LogLevel.ERROR: console.error(formatted); - break; + // Let's not ignore errors + process.exit(1); case LogLevel.WARNING: console.warn(formatted); break; @@ -98,9 +99,9 @@ export class MockAgent extends MockClient { public async finish(): Promise { await Promise.all(this.pendingActions); await this.client.settings.setSetting("isSyncEnabled", true); + this.client.stop(); await this.client.syncer.waitForSyncQueue(); await this.client.syncer.applyRemoteChangesLocally(); - this.client.stop(); } public assertFileSystemsAreConsistent(otherAgent: MockAgent): void { @@ -216,7 +217,7 @@ export class MockAgent extends MockClient { ); return this.client.settings.setSetting( "fetchChangesUpdateIntervalMs", - Math.random() * 1000 + Math.random() * 2000 + 100 ); }