Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function runSetup () {
'use strict';
var path = fs.join(db._path(), 'collection-999999999999-123456');
fs.makeDirectory(path);
fs.write(fs.join(path, '.tmp'), ''); // create .tmp file
path = fs.join(db._path(), 'collection-999999999998-123456.tmp');
fs.makeDirectory(path);
internal.debugTerminate('crashing server');
}
function runSetup () {
'use strict';
internal.debugClearFailAt();
db._drop('UnitTestsRecovery');
var c = db._create('UnitTestsRecovery'), i;
for (i = 0; i < 10000; ++i) {
c.save({ _key: 'test' + i, value1: 'test' + i, value2: i });
}
internal.debugSetFailAt('CollectorThreadProcessQueuedOperations');
internal.wal.flush(true, false);
internal.wait(5);
internal.debugTerminate('crashing server');
}
function runSetup () {
'use strict';
internal.debugClearFailAt();
var v;
db._dropView('UnitTestsRecovery');
v = db._createView('UnitTestsRecovery', 'arangosearch', {});
db._dropView('UnitTestsRecovery');
internal.debugTerminate('crashing server');
}
////////////////////////////////////////////////////////////////////////////////
function runSetup () {
'use strict';
internal.debugClearFailAt();
db._drop('UnitTestsRecovery');
var c = db._create('UnitTestsRecovery'), i;
c.save({ _key: 'value', value: 42 });
for (i = 0; i < 200000; ++i) {
c.update('value', { value: i });
}
c.save({ _key: 'crashme' }, true);
internal.debugTerminate('crashing server');
}
function runSetup () {
'use strict';
internal.debugClearFailAt();
db._drop('UnitTestsRecovery');
var c = db._create('UnitTestsRecovery');
for (var i = 0; i < 10000; ++i) {
c.insert({ _key: 'test' + i, value: i });
}
c.truncate({ waitForSync: true, intermediateCommitCount: 1000 });
internal.debugTerminate('crashing server');
}