diff options
Diffstat (limited to 'jstests/disk/wt_corrupt_file_errors.js')
-rw-r--r-- | jstests/disk/wt_corrupt_file_errors.js | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/jstests/disk/wt_corrupt_file_errors.js b/jstests/disk/wt_corrupt_file_errors.js index c45b5ae80df..28fa915002e 100644 --- a/jstests/disk/wt_corrupt_file_errors.js +++ b/jstests/disk/wt_corrupt_file_errors.js @@ -16,13 +16,23 @@ const dbpath = MongoRunner.dataPath + baseName + "/"; * Test 1. Corrupt a collection's .wt file. */ -assertErrorOnStartupWhenFilesAreCorruptOrMissing(dbpath, baseName, collName, (mongod, testColl) => { - const testCollUri = getUriForColl(testColl); - const testCollFile = dbpath + testCollUri + ".wt"; - MongoRunner.stopMongod(mongod); - jsTestLog("corrupting collection file: " + testCollFile); - corruptFile(testCollFile); -}, "Fatal Assertion 50882"); +assertErrorOnRequestWhenFilesAreCorruptOrMissing( + dbpath, + baseName, + collName, + (mongod, testColl) => { + const testCollUri = getUriForColl(testColl); + const testCollFile = dbpath + testCollUri + ".wt"; + MongoRunner.stopMongod(mongod); + jsTestLog("corrupting collection file: " + testCollFile); + corruptFile(testCollFile); + }, + (testColl) => { + assert.throws(() => { + testColl.insert({a: 1}); + }); + }, + "Fatal Assertion 50882"); /** * Test 2. Corrupt the _mdb_catalog. |