Skip to content

Commit 8d2e3c3

Browse files
failing seed
1 parent e5b9d7d commit 8d2e3c3

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

packages/dds/map/src/test/directroyOracle.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ export class SharedDirectoryOracle {
3434
private captureInitialSnapshot(dir: IDirectory): void {
3535
// Capture keys
3636
for (const [key, value] of dir.entries()) {
37-
this.model.set(`${dir.absolutePath}/${key}`, value);
37+
const pathKey = dir.absolutePath === "/" ? `/${key}` : `${dir.absolutePath}/${key}`;
38+
39+
this.model.set(pathKey, value);
3840
}
3941

4042
for (const [, subDir] of dir.subdirectories()) {
@@ -49,10 +51,12 @@ export class SharedDirectoryOracle {
4951
const fuzzDir = this.sharedDir.getWorkingDirectory(path);
5052
if (!fuzzDir) return;
5153

54+
const pathKey = path === "/" ? `/${key}` : `${path}/${key}`;
55+
5256
if (fuzzDir.has(key)) {
53-
this.model.set(`${path}/${key}`, fuzzDir.get(key));
57+
this.model.set(pathKey, fuzzDir.get(key));
5458
} else {
55-
this.model.delete(`${path}/${key}`);
59+
this.model.delete(pathKey);
5660
}
5761
};
5862

@@ -116,7 +120,7 @@ export class SharedDirectoryOracle {
116120
assert.deepStrictEqual(
117121
actual,
118122
value,
119-
`SharedDirectoryOracle mismatch at path="${pathKey}" with actual value = ${actual} and oracle value = ${value}}`,
123+
`SharedDirectoryOracle mismatch at path="${pathKey}" with actual value = ${actual} and oracle value = ${value} with model entries = ${JSON.stringify(this.model.entries())}}`,
120124
);
121125
}
122126
}

packages/dds/map/src/test/mocha/directoryFuzzTests.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ describe("SharedDirectory fuzz", () => {
125125
type: "fixedInterval",
126126
interval: dirDefaultOptions.validateInterval,
127127
},
128+
skipMinimization: true,
128129
reconnectProbability: 0.15,
129130
numberOfClients: 3,
130131
clientJoinOptions: {
@@ -137,9 +138,9 @@ describe("SharedDirectory fuzz", () => {
137138
defaultTestCount: 25,
138139
emitter: oracleEmitter,
139140
// Uncomment this line to replay a specific seed from its failure file:
140-
// replay: 0,
141+
only: 13,
141142
saveFailures: { directory: dirPath.join(_dirname, "../../../src/test/mocha/results/2") },
142-
skip: [13],
143+
skip: [],
143144
});
144145

145146
createDDSFuzzSuite(

0 commit comments

Comments
 (0)