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';
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();
db._drop('UnitTestsRecoveryDummy');
var c = db._create('UnitTestsRecoveryDummy');
db._dropView('UnitTestsRecovery1');
var v1 = db._createView('UnitTestsRecovery1', 'arangosearch', {});
c.save({ _key: 'crashme' }, true);
internal.debugSegfault('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');
}