This commit is contained in:
Andras Schmelczer 2025-03-15 09:25:09 +00:00
parent 408afa3626
commit e3196c2dc0
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
10 changed files with 338 additions and 301 deletions

View file

@ -83,8 +83,6 @@ export class MockAgent extends MockClient {
}
public async act(): Promise<void> {
this.assertAllContentIsPresentOnce();
const options: (() => Promise<unknown>)[] = [
this.createFileAction.bind(this),
this.changeFetchChangesUpdateIntervalMsAction.bind(this)

View file

@ -1,3 +1,4 @@
import { assert } from "../utils/assert";
import type {
RelativePath,
FileSystemOperations,
@ -81,6 +82,18 @@ export class MockClient implements FileSystemOperations {
const newContentUint8Array = new TextEncoder().encode(newContent);
this.localFiles.set(path, newContentUint8Array);
const existingPats = currentContent
.split(" ")
.map((part) => part.trim());
const newParts = newContent.split(" ").map((part) => part.trim());
existingPats.forEach((part) =>
// all changes should be additive
assert(
newParts.includes(part),
`Part ${part} not found in new content`
)
);
this.client.logger.info(
`Updated file ${path} with:\n current content: ${currentContent}\n new content: ${newContent}`
);

View file

@ -92,16 +92,16 @@ 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];
for (let i = 0; i < 10; i++) {
for (const agentCount of agentCounts) {
for (const concurrency of concurrencies) {
for (const jitter of jitterScaleInSeconds) {
for (const iteration of iterations) {
for (const deleteFiles of doDeletes) {
for (const agentCount of agentCounts) {
for (const concurrency of concurrencies) {
for (const jitter of jitterScaleInSeconds) {
for (const iteration of iterations) {
for (const deleteFiles of doDeletes) {
for (let i = 0; i < 10; i++) {
await runTest({
agentCount,
concurrency,
@ -110,6 +110,7 @@ async function runTests(): Promise<void> {
jitterScaleInSeconds: jitter
});
}
return;
}
}
}