Improve testing
This commit is contained in:
parent
36633dfbcb
commit
cb3ffde342
3 changed files with 242 additions and 164 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
import { choose } from "../utils/choose";
|
import { choose } from "../utils/choose";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
import { v4 as uuidv4 } from "uuid";
|
||||||
import { assert } from "../utils/assert";
|
import { assert } from "../utils/assert";
|
||||||
import type { SyncSettings } from "sync-client";
|
import type { RelativePath, SyncSettings } from "sync-client";
|
||||||
import { LogLevel } from "sync-client";
|
import { LogLevel } from "sync-client";
|
||||||
import { MockClient } from "./mock-client";
|
import { MockClient } from "./mock-client";
|
||||||
import chalk from "chalk";
|
import chalk from "chalk";
|
||||||
|
|
@ -9,15 +9,15 @@ import chalk from "chalk";
|
||||||
export class MockAgent extends MockClient {
|
export class MockAgent extends MockClient {
|
||||||
private readonly writtenContents: string[] = [];
|
private readonly writtenContents: string[] = [];
|
||||||
private readonly pendingActions: Promise<unknown>[] = [];
|
private readonly pendingActions: Promise<unknown>[] = [];
|
||||||
|
private doNotTouch: string[] = [];
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
globalFiles: Record<string, Uint8Array>,
|
|
||||||
initialSettings: Partial<SyncSettings>,
|
initialSettings: Partial<SyncSettings>,
|
||||||
public readonly name: string,
|
public readonly name: string,
|
||||||
private readonly color: string,
|
private readonly color: string,
|
||||||
private readonly doDeletes: boolean
|
private readonly doDeletes: boolean
|
||||||
) {
|
) {
|
||||||
super(globalFiles, initialSettings);
|
super(initialSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async init(): Promise<void> {
|
public async init(): Promise<void> {
|
||||||
|
|
@ -49,86 +49,34 @@ export class MockAgent extends MockClient {
|
||||||
|
|
||||||
public async act(): Promise<void> {
|
public async act(): Promise<void> {
|
||||||
const options: (() => Promise<unknown>)[] = [
|
const options: (() => Promise<unknown>)[] = [
|
||||||
async (): Promise<unknown> => {
|
this.createFileAction.bind(this),
|
||||||
const file = this.getFileName();
|
this.changeFetchChangesUpdateIntervalMsAction.bind(this),
|
||||||
|
this.disableSyncAction.bind(this),
|
||||||
if (await this.exists(file)) {
|
this.enableSyncAction.bind(this)
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.client.logger.info(`Decided to create file ${file}`);
|
|
||||||
return this.create(
|
|
||||||
file,
|
|
||||||
new TextEncoder().encode(this.getContent())
|
|
||||||
);
|
|
||||||
},
|
|
||||||
async (): Promise<unknown> => {
|
|
||||||
this.client.logger.info(
|
|
||||||
`Decided to change fetchChangesUpdateIntervalMs`
|
|
||||||
);
|
|
||||||
return this.client.settings.setSetting(
|
|
||||||
"fetchChangesUpdateIntervalMs",
|
|
||||||
Math.random() * 1000
|
|
||||||
);
|
|
||||||
},
|
|
||||||
async (): Promise<unknown> => {
|
|
||||||
this.client.logger.info(`Decided to disable sync`);
|
|
||||||
return this.client.settings.setSetting("isSyncEnabled", false);
|
|
||||||
},
|
|
||||||
async (): Promise<unknown> => {
|
|
||||||
this.client.logger.info(`Decided to enable sync`);
|
|
||||||
return this.client.settings.setSetting("isSyncEnabled", true);
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const files = await this.listAllFiles();
|
const files = await this.listAllFiles();
|
||||||
|
|
||||||
if (files.length > 0) {
|
if (files.length > 0) {
|
||||||
options.push(
|
options.push(
|
||||||
async (): Promise<unknown> => {
|
this.renameFileAction.bind(this, files),
|
||||||
const file = choose(files);
|
this.updateFileAction.bind(this, files)
|
||||||
const newName = this.getFileName();
|
|
||||||
|
|
||||||
if (await this.exists(newName)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.client.logger.info(
|
|
||||||
`Decided to rename file ${file} to ${newName}`
|
|
||||||
);
|
|
||||||
return this.rename(file, newName);
|
|
||||||
},
|
|
||||||
async (): Promise<unknown> => {
|
|
||||||
const file = choose(files);
|
|
||||||
|
|
||||||
this.client.logger.info(`Decided to update file ${file}`);
|
|
||||||
return this.atomicUpdateText(
|
|
||||||
file,
|
|
||||||
(old) => old + " " + this.getContent()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (this.doDeletes) {
|
if (this.doDeletes) {
|
||||||
options.push(async (): Promise<unknown> => {
|
options.push(this.deleteFileAction.bind(this, files));
|
||||||
const file = choose(files);
|
|
||||||
this.client.logger.info(`Decided to delete file ${file}`);
|
|
||||||
return this.delete(file);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.pendingActions.push(
|
this.pendingActions.push(
|
||||||
(() => {
|
(async (): Promise<unknown> => {
|
||||||
try {
|
try {
|
||||||
return choose(options)();
|
return await choose(options)();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.client.logger.error(
|
this.client.logger.error(
|
||||||
`Failed to perform an action: ${error}`
|
`Failed to perform an action: ${error}`
|
||||||
);
|
);
|
||||||
this.client.logger.info(
|
this.client.logger.info(JSON.stringify(this.data, null, 2));
|
||||||
JSON.stringify(JSON.parse(this.data as any), null, 2)
|
|
||||||
);
|
|
||||||
this.client.logger.info(
|
this.client.logger.info(
|
||||||
JSON.stringify(this.localFiles, null, 2)
|
JSON.stringify(this.localFiles, null, 2)
|
||||||
);
|
);
|
||||||
|
|
@ -141,71 +89,180 @@ export class MockAgent extends MockClient {
|
||||||
public async finish(): Promise<void> {
|
public async finish(): Promise<void> {
|
||||||
await Promise.all(this.pendingActions);
|
await Promise.all(this.pendingActions);
|
||||||
await this.client.settings.setSetting("isSyncEnabled", true);
|
await this.client.settings.setSetting("isSyncEnabled", true);
|
||||||
await this.client.syncer.applyRemoteChangesLocally();
|
|
||||||
await this.client.syncer.waitForSyncQueue();
|
await this.client.syncer.waitForSyncQueue();
|
||||||
|
await this.client.syncer.applyRemoteChangesLocally();
|
||||||
this.client.stop();
|
this.client.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
public assertFileSystemIsConsistent(): void {
|
public assertFileSystemsAreConsistent(otherAgent: MockAgent): void {
|
||||||
const globalFiles = Object.keys(this.globalFiles);
|
const globalFiles = Array.from(otherAgent.localFiles.keys());
|
||||||
const localFiles = Object.keys(this.localFiles);
|
const localFiles = Array.from(this.localFiles.keys());
|
||||||
|
|
||||||
const missingInGlobal = localFiles.filter(
|
const missingInOther = localFiles.filter(
|
||||||
(file) => !(file in this.globalFiles)
|
(file) => !otherAgent.localFiles.has(file)
|
||||||
);
|
);
|
||||||
const missingInLocal = globalFiles.filter(
|
const missingInLocal = globalFiles.filter(
|
||||||
(file) => !(file in this.localFiles)
|
(file) => !this.localFiles.has(file)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
try {
|
||||||
assert(
|
assert(
|
||||||
missingInGlobal.length === 0,
|
missingInOther.length === 0,
|
||||||
`Files missing in global files: ${missingInGlobal.join(", ")}`
|
`Files from ${this.name} missing in ${otherAgent.name}: ${missingInOther.join(", ")}`
|
||||||
);
|
);
|
||||||
assert(
|
assert(
|
||||||
missingInLocal.length === 0,
|
missingInLocal.length === 0,
|
||||||
`Files missing in local files: ${missingInLocal.join(", ")}`
|
`Files from ${otherAgent.name} missing in ${this.name}: ${missingInLocal.join(", ")}`
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const file of globalFiles) {
|
for (const file of globalFiles) {
|
||||||
const localContent = new TextDecoder().decode(
|
const localContent = new TextDecoder().decode(
|
||||||
this.localFiles[file]
|
this.localFiles.get(file)
|
||||||
);
|
);
|
||||||
const globalContent = new TextDecoder().decode(
|
const otherContent = new TextDecoder().decode(
|
||||||
this.globalFiles[file]
|
otherAgent.localFiles.get(file)
|
||||||
);
|
);
|
||||||
assert(
|
assert(
|
||||||
localContent === globalContent,
|
localContent === otherContent,
|
||||||
`Content mismatch for file ${file}: ${localContent} <> ${globalContent}`
|
`Content mismatch for file ${file}:\n${localContent}\n${otherContent}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.client.logger.info(
|
||||||
|
"Local data: " + JSON.stringify(this.data, null, 2)
|
||||||
|
);
|
||||||
|
this.client.logger.info(
|
||||||
|
"Local files: " +
|
||||||
|
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(", ")
|
||||||
|
);
|
||||||
|
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public assertAllContentIsPresentOnce(): void {
|
public assertAllContentIsPresentOnce(): void {
|
||||||
for (const content of this.writtenContents) {
|
for (const content of this.writtenContents) {
|
||||||
const found = Object.values(this.localFiles).filter((file) => {
|
const found = Array.from(this.localFiles.keys()).filter((key) => {
|
||||||
return new TextDecoder().decode(file).includes(content);
|
return new TextDecoder()
|
||||||
|
.decode(this.localFiles.get(key))
|
||||||
|
.includes(content);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.doDeletes) {
|
if (this.doDeletes) {
|
||||||
assert(
|
assert(
|
||||||
found.length <= 1,
|
found.length <= 1,
|
||||||
`Content ${content} found in ${found.length} files`
|
`[${this.name}] Content ${content} found in ${found.join(", ")}`
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
assert(
|
assert(
|
||||||
found.length === 1,
|
found.length >= 1,
|
||||||
`Content ${content} found in ${found.length} files`
|
`[${this.name}] Content ${content} not found in any files`
|
||||||
|
);
|
||||||
|
|
||||||
|
assert(
|
||||||
|
found.length <= 1,
|
||||||
|
`[${this.name}] Content ${content} found in multiple files: ${found.join(", ")}`
|
||||||
);
|
);
|
||||||
|
|
||||||
const [file] = found;
|
const [file] = found;
|
||||||
|
const fileContent = new TextDecoder().decode(
|
||||||
|
this.localFiles.get(file)
|
||||||
|
);
|
||||||
assert(
|
assert(
|
||||||
new TextDecoder().decode(file).split(content).length === 2,
|
fileContent.split(content).length == 2,
|
||||||
`Content ${content} found more than once in a file`
|
`Content ${content} (of ${this.name}) found more than once in file ${file}. File content:\n${fileContent}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async createFileAction(): Promise<void> {
|
||||||
|
const file = this.getFileName();
|
||||||
|
|
||||||
|
if (await this.exists(file)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const content = this.getContent();
|
||||||
|
this.client.logger.info(
|
||||||
|
`Decided to create file ${file} with content ${content}`
|
||||||
|
);
|
||||||
|
|
||||||
|
return this.create(
|
||||||
|
file,
|
||||||
|
new TextEncoder().encode(` |${content}| `)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async changeFetchChangesUpdateIntervalMsAction(): Promise<void> {
|
||||||
|
this.client.logger.info(
|
||||||
|
`Decided to change fetchChangesUpdateIntervalMs`
|
||||||
|
);
|
||||||
|
return this.client.settings.setSetting(
|
||||||
|
"fetchChangesUpdateIntervalMs",
|
||||||
|
Math.random() * 1000
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async disableSyncAction(): Promise<void> {
|
||||||
|
this.client.logger.info(`Decided to disable sync`);
|
||||||
|
await this.client.settings.setSetting("isSyncEnabled", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async enableSyncAction(): Promise<void> {
|
||||||
|
this.client.logger.info(`Decided to enable sync`);
|
||||||
|
await this.client.settings.setSetting("isSyncEnabled", true);
|
||||||
|
this.doNotTouch = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
private async renameFileAction(files: RelativePath[]): Promise<void> {
|
||||||
|
const file = choose(files);
|
||||||
|
const newName = this.getFileName();
|
||||||
|
|
||||||
|
if (await this.exists(newName)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.client.logger.info(`Decided to rename file ${file} to ${newName}`);
|
||||||
|
if (!this.client.settings.getSettings().isSyncEnabled) {
|
||||||
|
this.doNotTouch.push(newName);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.rename(file, newName);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async updateFileAction(files: RelativePath[]): Promise<void> {
|
||||||
|
const file = choose(files);
|
||||||
|
|
||||||
|
// We can't edit files offline that have been renamed while offline.
|
||||||
|
// Othwersie, the resolution logic couldn't handle it.
|
||||||
|
if (this.doNotTouch.includes(file)) {
|
||||||
|
this.client.logger.info(
|
||||||
|
`Skipping file ${file} because it has been renamed while offline`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const content = this.getContent();
|
||||||
|
this.client.logger.info(
|
||||||
|
`Decided to update file ${file} with ${content}`
|
||||||
|
);
|
||||||
|
await this.atomicUpdateText(file, (old) => old + ` |${content}| `);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async deleteFileAction(files: RelativePath[]): Promise<void> {
|
||||||
|
const file = choose(files);
|
||||||
|
this.client.logger.info(`Decided to delete file ${file}`);
|
||||||
|
return this.delete(file);
|
||||||
|
}
|
||||||
|
|
||||||
private getContent(): string {
|
private getContent(): string {
|
||||||
const uuid = uuidv4();
|
const uuid = uuidv4();
|
||||||
this.writtenContents.push(uuid);
|
this.writtenContents.push(uuid);
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,10 @@ export class MockClient implements FileSystemOperations {
|
||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
Object.keys(this.initialSettings).map(async (key) => {
|
Object.keys(this.initialSettings).map(async (key) => {
|
||||||
if (key in this.client.settings) {
|
|
||||||
return this.client.settings.setSetting(
|
return this.client.settings.setSetting(
|
||||||
key as keyof SyncSettings, // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
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
|
this.initialSettings[key as keyof SyncSettings] // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
||||||
);
|
);
|
||||||
}
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -93,6 +91,10 @@ export class MockClient implements FileSystemOperations {
|
||||||
const newContentUint8Array = new TextEncoder().encode(newContent);
|
const newContentUint8Array = new TextEncoder().encode(newContent);
|
||||||
this.localFiles.set(path, newContentUint8Array);
|
this.localFiles.set(path, newContentUint8Array);
|
||||||
|
|
||||||
|
this.client.logger.info(
|
||||||
|
`Updated file ${path} with:\n current content: ${currentContent}\n new content: ${newContent}`
|
||||||
|
);
|
||||||
|
|
||||||
void this.client.syncer.syncLocallyUpdatedFile({
|
void this.client.syncer.syncLocallyUpdatedFile({
|
||||||
relativePath: path,
|
relativePath: path,
|
||||||
updateTime: new Date()
|
updateTime: new Date()
|
||||||
|
|
@ -104,6 +106,10 @@ export class MockClient implements FileSystemOperations {
|
||||||
public async write(path: RelativePath, content: Uint8Array): Promise<void> {
|
public async write(path: RelativePath, content: Uint8Array): Promise<void> {
|
||||||
this.localFiles.set(path, content);
|
this.localFiles.set(path, content);
|
||||||
|
|
||||||
|
this.client.logger.info(
|
||||||
|
`Updated file ${path} with:\n new content: ${new TextDecoder().decode(content)}`
|
||||||
|
);
|
||||||
|
|
||||||
void this.client.syncer.syncLocallyUpdatedFile({
|
void this.client.syncer.syncLocallyUpdatedFile({
|
||||||
relativePath: path,
|
relativePath: path,
|
||||||
updateTime: new Date()
|
updateTime: new Date()
|
||||||
|
|
|
||||||
|
|
@ -3,72 +3,57 @@ import { MockAgent } from "./agent/mock-agent";
|
||||||
import { sleep } from "./utils/sleep";
|
import { sleep } from "./utils/sleep";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
import { v4 as uuidv4 } from "uuid";
|
||||||
|
|
||||||
const globalFiles: Record<string, Uint8Array> = {};
|
async function runTest({
|
||||||
const iterations = 100;
|
agentCount,
|
||||||
const doDeletes = false;
|
concurrency,
|
||||||
|
iterations,
|
||||||
async function runTest(): Promise<void> {
|
doDeletes
|
||||||
console.info("Starting test");
|
}: {
|
||||||
|
agentCount: number;
|
||||||
|
concurrency: number;
|
||||||
|
iterations: number;
|
||||||
|
doDeletes: boolean;
|
||||||
|
}): Promise<void> {
|
||||||
|
console.info(
|
||||||
|
`Running test with ${agentCount} agents, concurrency ${concurrency}, iterations ${iterations}, doDeletes ${doDeletes}`
|
||||||
|
);
|
||||||
|
|
||||||
const initialSettings: Partial<SyncSettings> = {
|
const initialSettings: Partial<SyncSettings> = {
|
||||||
isSyncEnabled: true,
|
isSyncEnabled: true,
|
||||||
token: "token",
|
token: "token",
|
||||||
vaultName: uuidv4(),
|
vaultName: uuidv4(),
|
||||||
|
syncConcurrency: concurrency,
|
||||||
remoteUri: "http://localhost:3030"
|
remoteUri: "http://localhost:3030"
|
||||||
};
|
};
|
||||||
|
|
||||||
const clients = [
|
const clients: MockAgent[] = [];
|
||||||
new MockAgent(
|
for (let i = 0; i < agentCount; i++) {
|
||||||
globalFiles,
|
clients.push(
|
||||||
initialSettings,
|
new MockAgent(initialSettings, `agent-${i}`, "#ff0000", doDeletes)
|
||||||
"agent-1",
|
);
|
||||||
"#ff0000",
|
}
|
||||||
doDeletes
|
|
||||||
),
|
|
||||||
new MockAgent(
|
|
||||||
globalFiles,
|
|
||||||
initialSettings,
|
|
||||||
"agent-2",
|
|
||||||
"#00ff00",
|
|
||||||
doDeletes
|
|
||||||
),
|
|
||||||
new MockAgent(
|
|
||||||
globalFiles,
|
|
||||||
initialSettings,
|
|
||||||
"agent-3",
|
|
||||||
"#0000ff",
|
|
||||||
doDeletes
|
|
||||||
),
|
|
||||||
new MockAgent(
|
|
||||||
globalFiles,
|
|
||||||
initialSettings,
|
|
||||||
"agent-4",
|
|
||||||
"#ffaa00",
|
|
||||||
doDeletes
|
|
||||||
),
|
|
||||||
new MockAgent(
|
|
||||||
globalFiles,
|
|
||||||
initialSettings,
|
|
||||||
"agent-5",
|
|
||||||
"#00ffaa",
|
|
||||||
doDeletes
|
|
||||||
)
|
|
||||||
];
|
|
||||||
|
|
||||||
|
try {
|
||||||
await Promise.all(clients.map(async (client) => client.init()));
|
await Promise.all(clients.map(async (client) => client.init()));
|
||||||
|
|
||||||
for (let i = 0; i < iterations; i++) {
|
for (let i = 0; i < iterations; i++) {
|
||||||
|
console.info(`Iteration ${i + 1}/${iterations}`);
|
||||||
await Promise.all(clients.map(async (client) => client.act()));
|
await Promise.all(clients.map(async (client) => client.act()));
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
await Promise.all(clients.map(async (client) => client.finish()));
|
for (const client of clients) {
|
||||||
|
// todo: make it less hacky
|
||||||
|
await client.finish();
|
||||||
|
}
|
||||||
|
|
||||||
console.info("Agents finished successfully");
|
console.info("Agents finished successfully");
|
||||||
|
|
||||||
clients.forEach((client) => {
|
clients.slice(0, -1).forEach((client, i) => {
|
||||||
console.info(`Checking consistency for ${client.name}`);
|
console.info(
|
||||||
client.assertFileSystemIsConsistent();
|
`Checking consistency between ${client.name} and ${clients[i + 1].name}`
|
||||||
|
);
|
||||||
|
client.assertFileSystemsAreConsistent(clients[i]);
|
||||||
console.info(`Consistency check for ${client.name} passed`);
|
console.info(`Consistency check for ${client.name} passed`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -80,10 +65,40 @@ async function runTest(): Promise<void> {
|
||||||
console.info(`Content check for ${client.name} passed`);
|
console.info(`Content check for ${client.name} passed`);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.info("Test completed successfully");
|
console.info(
|
||||||
|
`Test passed with ${agentCount} agents, concurrency ${concurrency}, iterations ${iterations}, doDeletes ${doDeletes}`
|
||||||
|
);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(
|
||||||
|
`Test failed with ${agentCount} agents, concurrency ${concurrency}, iterations ${iterations}, doDeletes ${doDeletes}`
|
||||||
|
);
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
runTest()
|
async function runTests(): Promise<void> {
|
||||||
|
const agentCounts = [2, 10];
|
||||||
|
const concurrencies = [1, 16];
|
||||||
|
const iterations = [300];
|
||||||
|
const doDeletes = [false, true];
|
||||||
|
|
||||||
|
for (const agentCount of agentCounts) {
|
||||||
|
for (const concurrency of concurrencies) {
|
||||||
|
for (const iteration of iterations) {
|
||||||
|
for (const deleteFiles of doDeletes) {
|
||||||
|
await runTest({
|
||||||
|
agentCount,
|
||||||
|
concurrency,
|
||||||
|
iterations: iteration,
|
||||||
|
doDeletes: deleteFiles
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
runTests()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue