From be556b726236dfeed1d604827d15aa0bb2e36f10 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Tue, 30 Oct 2018 19:04:11 +0100 Subject: [PATCH] backport testing changes (#7127) --- js/client/modules/@arangodb/process-utils.js | 19 +++++++------------ js/client/modules/@arangodb/testing.js | 2 +- .../modules/@arangodb/testsuites/recovery.js | 6 +++--- .../@arangodb/testsuites/replication.js | 15 +++++++++++---- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/js/client/modules/@arangodb/process-utils.js b/js/client/modules/@arangodb/process-utils.js index 6891564c1a..ba852bc6cd 100755 --- a/js/client/modules/@arangodb/process-utils.js +++ b/js/client/modules/@arangodb/process-utils.js @@ -381,7 +381,7 @@ function makeArgsArangod (options, appDir, role, tmpDir) { function runProcdump (options, instanceInfo, rootDir, pid) { let procdumpArgs = [ ]; - let dumpFile = fs.join(rootDir, 'core_'+pid + '.dmp'); + let dumpFile = fs.join(rootDir, 'core_' + pid + '.dmp'); if (options.exceptionFilter != null) { procdumpArgs = [ '-accepteula', @@ -499,11 +499,6 @@ function executeAndWait (cmd, args, options, valgrindTest, rootDir, circumventCo (platform.substr(0, 3) === 'win') ) ) { - let instanceInfo = { - rootDir: rootDir, - pid: res.pid, - exitStatus: res - }; print("executeAndWait: Marking crashy - " + JSON.stringify(instanceInfo)); crashUtils.analyzeCrash(cmd, instanceInfo, @@ -1366,12 +1361,12 @@ function startInstance (protocol, options, addArgs, testname, tmpDir) { const startTime = time(); try { if (options.hasOwnProperty('server')) { - let rc = { - endpoint: options.server, - rootDir: options.serverRoot, - url: options.server.replace('tcp', 'http'), - arangods: [] - }; + let rc = { + endpoint: options.server, + rootDir: options.serverRoot, + url: options.server.replace('tcp', 'http'), + arangods: [] + }; arango.reconnect(rc.endpoint, '_system', 'root', ''); return rc; } else if (options.cluster || options.activefailover) { diff --git a/js/client/modules/@arangodb/testing.js b/js/client/modules/@arangodb/testing.js index 51b7818739..cd406379a5 100755 --- a/js/client/modules/@arangodb/testing.js +++ b/js/client/modules/@arangodb/testing.js @@ -654,7 +654,7 @@ function iterateTests(cases, options, jsonReply) { } else { print('not cleaning up as some tests weren\'t successful:\n' + pu.getCleanupDBDirectories() + - cleanup + ' - ' + globalStatus + ' - ' + pu.serverCrashed); + cleanup + ' - ' + globalStatus + ' - ' + pu.serverCrashed); } } else { print("not cleaning up since we didn't start the server ourselves\n"); diff --git a/js/client/modules/@arangodb/testsuites/recovery.js b/js/client/modules/@arangodb/testsuites/recovery.js index 830b3ce9d7..2f5d9a5a34 100644 --- a/js/client/modules/@arangodb/testsuites/recovery.js +++ b/js/client/modules/@arangodb/testsuites/recovery.js @@ -152,17 +152,18 @@ function recovery (options) { let filtered = {}; let localOptions = _.cloneDeep(options); let disableMonitor = localOptions.disableMonitor; + if (tu.filterTestcaseByOptions(test, localOptions, filtered)) { let instanceInfo = { rootDir: pu.UNITTESTS_DIR }; count += 1; - localOptions.disableMonitor = true; print(BLUE + "running setup of " + test + RESET); + localOptions.disableMonitor = true; runArangodRecovery(instanceInfo, localOptions, test, true, count); - localOptions.disableMonitor = disableMonitor; + print(BLUE + "running recovery of " + test + RESET); results[test] = runArangodRecovery(instanceInfo, localOptions, test, false, count); @@ -178,7 +179,6 @@ function recovery (options) { } } } - process.env.TMPDIR = orgTmp; if (count === 0) { results['ALLTESTS'] = { diff --git a/js/client/modules/@arangodb/testsuites/replication.js b/js/client/modules/@arangodb/testsuites/replication.js index 1cf00fe74a..84268905d1 100644 --- a/js/client/modules/@arangodb/testsuites/replication.js +++ b/js/client/modules/@arangodb/testsuites/replication.js @@ -1,4 +1,5 @@ /* jshint strict: false, sub: true */ +/* global print */ 'use strict'; // ////////////////////////////////////////////////////////////////////////////// @@ -81,7 +82,8 @@ function replicationFuzz (options) { customInstanceInfos, startStopHandlers) { let message; - let slave = pu.startInstance('tcp', options, {}, 'slave_sync'); + print("starting replication slave: "); + let slave = pu.startInstance('tcp', options, {}, 'slave_fuzz'); let state = (typeof slave === 'object'); if (state) { @@ -149,7 +151,8 @@ function replicationRandom (options) { customInstanceInfos, startStopHandlers) { let message; - let slave = pu.startInstance('tcp', options, {}, 'slave_sync'); + print("starting replication slave: "); + let slave = pu.startInstance('tcp', options, {}, 'slave_random'); let state = (typeof slave === 'object'); if (state) { @@ -218,7 +221,8 @@ function replicationAql (options) { customInstanceInfos, startStopHandlers) { let message; - let slave = pu.startInstance('tcp', options, {}, 'slave_sync'); + print("starting replication slave: "); + let slave = pu.startInstance('tcp', options, {}, 'slave_aql'); let state = (typeof slave === 'object'); if (state) { @@ -290,6 +294,7 @@ function replicationOngoing (options) { customInstanceInfos, startStopHandlers) { let message; + print("starting replication slave: "); let slave = pu.startInstance('tcp', options, {}, 'slave_ongoing'); let state = (typeof slave === 'object'); @@ -363,6 +368,7 @@ function replicationStatic (options) { startStopHandlers) { let message; let res = true; + print("starting replication slave: "); let slave = pu.startInstance('tcp', options, {}, 'slave_static'); let state = (typeof slave === 'object'); @@ -459,7 +465,8 @@ function replicationSync (options) { startStopHandlers) { let message; let res = true; - let slave = pu.startInstance('tcp', options, {}, 'slave_sync'); + print("starting replication slave: "); + let slave = pu.startInstance('tcp', options, {"log.level" : "replication=trace", "--log.level": "replication=trace"}, 'slave_sync'); let state = (typeof slave === 'object'); if (state) {