Skip to content

Commit 8f4af04

Browse files
committed
fixin: updating fast-check timeouts and run counts
1 parent a2322fa commit 8f4af04

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

tests/EncryptedFS.concurrent.test.ts

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
2020
new StreamHandler(),
2121
]);
2222
const dbKey: Buffer = utils.generateKeySync(256);
23+
const interruptAfterTimeLimit = globalThis.defaultTimeout - 2000;
2324
let dataDir: string;
2425
let db: DB;
2526
let iNodeMgr: INodeManager;
@@ -120,7 +121,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
120121
// Cleaning up
121122
await efs.rmdir('dir', { recursive: true });
122123
}),
123-
{ numRuns: 50 },
124+
{ interruptAfterTimeLimit },
124125
);
125126
});
126127
test('EncryptedFS.open', async () => {
@@ -328,7 +329,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
328329
await efs.close(fd);
329330
}
330331
}),
331-
{ numRuns: 10 },
332+
{ numRuns: 20, interruptAfterTimeLimit },
332333
);
333334
});
334335
test('EncryptedFS.write on the same file descriptor', async () => {
@@ -349,7 +350,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
349350
).toHaveLength(6);
350351
await efs.close(fd);
351352
}),
352-
{ numRuns: 10 },
353+
{ numRuns: 20, interruptAfterTimeLimit },
353354
);
354355
});
355356
test('EncryptedFS.writeFile', async () => {
@@ -369,7 +370,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
369370
).toHaveLength(4);
370371
expect(await totalINodes(iNodeMgr)).toEqual(2);
371372
}),
372-
{ numRuns: 10 },
373+
{ numRuns: 20, interruptAfterTimeLimit },
373374
);
374375
});
375376
test('EncryptedFS.appendFile', async () => {
@@ -397,7 +398,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
397398
await efs.readFile('test', { encoding: 'utf-8' }),
398399
);
399400
}),
400-
{ numRuns: 10 },
401+
{ numRuns: 20, interruptAfterTimeLimit },
401402
);
402403
});
403404
test('EncryptedFS.fallocate, EncryptedFS.writeFile, EncryptedFS.write and EncryptedFS.createWriteStream ', async () => {
@@ -440,7 +441,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
440441
// Cleaning up
441442
await efs.rmdir('dir', { recursive: true });
442443
}),
443-
{ numRuns: 50 },
444+
{ interruptAfterTimeLimit },
444445
);
445446
});
446447
test('EncryptedFS.fallocate and EncryptedFS.writeFile', async () => {
@@ -784,7 +785,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
784785
// Cleaning up
785786
await efs.rmdir('dir', { recursive: true });
786787
}),
787-
{ numRuns: 50 },
788+
{ interruptAfterTimeLimit },
788789
);
789790
});
790791
test('EncryptedFS.truncate and EncryptedFS.writeFile', async () => {
@@ -1137,7 +1138,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
11371138
// Cleaning up
11381139
await efs.rmdir('dir', { recursive: true });
11391140
}),
1140-
{ numRuns: 50 },
1141+
{ interruptAfterTimeLimit },
11411142
);
11421143
});
11431144
test('EncryptedFS.ftruncate and EncryptedFS.writeFile', async () => {
@@ -1473,6 +1474,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
14731474
// Cleaning up
14741475
await efs.rmdir('dir', { recursive: true });
14751476
}),
1477+
{ interruptAfterTimeLimit },
14761478
);
14771479
});
14781480
test('EncryptedFS.utimes and EncryptedFS.writeFile', async () => {
@@ -1682,7 +1684,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
16821684
// Cleaning up
16831685
await efs.rmdir('dir', { recursive: true });
16841686
}),
1685-
{ numRuns: 50 },
1687+
{ interruptAfterTimeLimit },
16861688
);
16871689
});
16881690
test('EncryptedFS.lseek and EncryptedFS.writeFile', async () => {
@@ -2114,7 +2116,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
21142116
// Cleaning up
21152117
await efs.rmdir('dir', { recursive: true });
21162118
}),
2117-
{ numRuns: 50 },
2119+
{ interruptAfterTimeLimit },
21182120
);
21192121
});
21202122
test('EncryptedFS.createReadStream and EncryptedFS.createWriteStream', async () => {
@@ -2620,7 +2622,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
26202622
// Cleaning up
26212623
await efs.rmdir('dir', { recursive: true });
26222624
}),
2623-
{ numRuns: 50 },
2625+
{ interruptAfterTimeLimit },
26242626
);
26252627
});
26262628
test('EncryptedFS.unlink and EncryptedFS.writeFile', async () => {
@@ -2902,7 +2904,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
29022904
// Cleaning up
29032905
await efs.rmdir('dir', { recursive: true });
29042906
}),
2905-
{ numRuns: 50 },
2907+
{ interruptAfterTimeLimit },
29062908
);
29072909
});
29082910
test('EncryptedFS.appendFIle and EncryptedFS.writeFile', async () => {
@@ -3252,7 +3254,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
32523254
// Cleaning up
32533255
await efs.rmdir('dir', { recursive: true });
32543256
}),
3255-
{ numRuns: 50 },
3257+
{ interruptAfterTimeLimit },
32563258
);
32573259
});
32583260
test('EncryptedFS.copyFile and EncryptedFS.writeFile', async () => {
@@ -3592,7 +3594,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
35923594
// Cleaning up
35933595
await efs.rmdir('dir', { recursive: true });
35943596
}),
3595-
{ numRuns: 20 },
3597+
{ numRuns: 20, interruptAfterTimeLimit },
35963598
);
35973599
});
35983600
test('EncryptedFS.read and EncryptedFS.write', async () => {
@@ -3633,7 +3635,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
36333635
// Cleaning up
36343636
await efs.rmdir('dir', { recursive: true });
36353637
}),
3636-
{ numRuns: 20 },
3638+
{ numRuns: 20, interruptAfterTimeLimit },
36373639
);
36383640
});
36393641
test('EncryptedFS.read and EncryptedFS.write with different fd', async () => {
@@ -3807,7 +3809,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
38073809
// Cleaning up
38083810
await efs.rmdir('dir', { recursive: true });
38093811
}),
3810-
{ numRuns: 20 },
3812+
{ interruptAfterTimeLimit },
38113813
);
38123814
});
38133815
test('EncryptedFS.mkdir', async () => {
@@ -3909,7 +3911,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
39093911
// Cleaning up
39103912
await efs.rmdir('dir', { recursive: true });
39113913
}),
3912-
{ numRuns: 20 },
3914+
{ interruptAfterTimeLimit },
39133915
);
39143916
});
39153917
test('EncryptedFS.readdir and EncryptedFS.rmdir', async () => {
@@ -4282,7 +4284,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
42824284
// Cleaning up
42834285
await efs.rmdir('dir', { recursive: true });
42844286
}),
4285-
{ numRuns: 20 },
4287+
{ numRuns: 20, interruptAfterTimeLimit },
42864288
);
42874289
});
42884290
});
@@ -4319,7 +4321,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
43194321
// Cleaning up
43204322
await efs.rmdir('dir', { recursive: true });
43214323
}),
4322-
{ numRuns: 20 },
4324+
{ interruptAfterTimeLimit },
43234325
);
43244326
});
43254327
test('EncryptedFS.symlink and EncryptedFS.symlink', async () => {
@@ -4556,7 +4558,7 @@ describe(`${EncryptedFS.name} Concurrency`, () => {
45564558
// Cleaning up
45574559
await efs.rmdir('dir', { recursive: true });
45584560
}),
4559-
{ numRuns: 20 },
4561+
{ numRuns: 20, interruptAfterTimeLimit },
45604562
);
45614563
});
45624564
test('EncryptedFS.link and EncryptedFS.link', async () => {

0 commit comments

Comments
 (0)