This commit is contained in:
Andras Schmelczer 2025-03-15 14:12:04 +00:00
commit 9ad54eff7a
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
21 changed files with 76 additions and 75 deletions

View file

@ -1,10 +1,10 @@
import { assert } from "../utils/assert";
import type {
RelativePath,
FileSystemOperations,
SyncSettings
import {
type RelativePath,
type FileSystemOperations,
type SyncSettings,
SyncClient
} from "sync-client";
import { SyncClient } from "sync-client";
export class MockClient implements FileSystemOperations {
protected readonly localFiles = new Map<string, Uint8Array>();
@ -24,8 +24,8 @@ export class MockClient implements FileSystemOperations {
await Promise.all(
Object.keys(this.initialSettings).map(async (key) => {
return this.client.settings.setSetting(
key as keyof SyncSettings, // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
this.initialSettings[key as keyof SyncSettings] // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
key as keyof SyncSettings,
this.initialSettings[key as keyof SyncSettings]!
);
})
);
@ -88,10 +88,10 @@ export class MockClient implements FileSystemOperations {
const newParts = newContent.split(" ").map((part) => part.trim());
existingParts.forEach((part) =>
// all changes should be additive
assert(
{ assert(
newParts.includes(part),
`Part ${part} not found in new content`
)
); }
);
this.client.logger.info(

View file

@ -92,7 +92,7 @@ async function runTest({
async function runTests(): Promise<void> {
const agentCounts = [2, 8];
const jitterScaleInSeconds = [0.5, 0, 2];
const concurrencies = [1];
const concurrencies = [16, 1];
const iterations = [50, 200];
const doDeletes = [true, false];
@ -101,7 +101,7 @@ async function runTests(): Promise<void> {
for (const jitter of jitterScaleInSeconds) {
for (const iteration of iterations) {
for (const deleteFiles of doDeletes) {
for (let i = 0; i < 10; i++) {
for (let i = 0; i < 20; i++) {
await runTest({
agentCount,
concurrency,
@ -110,7 +110,6 @@ async function runTests(): Promise<void> {
jitterScaleInSeconds: jitter
});
}
return;
}
}
}