Improve debugging

This commit is contained in:
Andras Schmelczer 2025-02-23 14:47:30 +00:00
parent abba023c20
commit ff5b987688
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
2 changed files with 11 additions and 1 deletions

View file

@ -70,6 +70,9 @@ export class MockClient implements FileSystemOperations {
if (this.localFiles.has(path)) {
throw new Error(`File ${path} already exists`);
}
this.client.logger.info(
`Creating file ${path} with content ${new TextDecoder().decode(newContent)}`
);
this.localFiles.set(path, newContent);
void this.client.syncer.syncLocallyCreatedFile(path, new Date());
}
@ -117,6 +120,9 @@ export class MockClient implements FileSystemOperations {
}
public async delete(path: RelativePath): Promise<void> {
this.client.logger.info(
`Deleting file: ${path} with:\n content ${new TextDecoder().decode(this.localFiles.get(path))}`
);
this.localFiles.delete(path);
void this.client.syncer.syncLocallyDeletedFile(path);
}
@ -134,6 +140,10 @@ export class MockClient implements FileSystemOperations {
this.localFiles.delete(oldPath);
}
this.client.logger.info(
`Renamed file: ${oldPath} -> ${newPath} with:\n content ${new TextDecoder().decode(file)}`
);
void this.client.syncer.syncLocallyUpdatedFile({
oldPath,
relativePath: newPath,

View file

@ -79,7 +79,7 @@ async function runTest({
async function runTests(): Promise<void> {
const agentCounts = [2, 10];
const concurrencies = [1, 16];
const iterations = [300];
const iterations = [50, 300];
const doDeletes = [false, true];
for (const agentCount of agentCounts) {