1
0
Fork 0

getDBServers response changed for aardvark frontend. needed reflection in resilienceMove tests

This commit is contained in:
Kaveh Vahedipour 2017-01-26 12:37:59 +01:00
parent 26167e87fd
commit f06fdf9e0f
2 changed files with 18 additions and 7 deletions

View File

@ -935,7 +935,7 @@ void Agent::beginShutdown() {
}
// Stop inception process
if (_inception != nullptr) {
if (size() > 1 && _inception != nullptr) {
_inception->beginShutdown();
}
@ -943,13 +943,14 @@ void Agent::beginShutdown() {
_spearhead.beginShutdown();
_readDB.beginShutdown();
if (_inception != nullptr) {
if (size() > 1 && _inception != nullptr) {
int counter = 0;
while (_inception->isRunning()) {
usleep(100000);
// emit warning after 5 seconds
if (++counter == 10 * 5) {
LOG_TOPIC(WARN, Logger::AGENCY) << "waiting for inception thread to finish";
LOG_TOPIC(WARN, Logger::AGENCY)
<< "waiting for inception thread to finish";
}
}
}

View File

@ -36,6 +36,16 @@ const _ = require("lodash");
const wait = require("internal").wait;
const supervisionState = require("@arangodb/cluster").supervisionState;
function getDBServers() {
var tmp = global.ArangoClusterInfo.getDBServers();
var servers = [];
for (var i = 0; i < tmp.length; ++i) {
servers[i] = tmp[i].serverId;
}
return servers;
}
const servers = getDBServers();
////////////////////////////////////////////////////////////////////////////////
/// @brief test suite
@ -46,7 +56,7 @@ function MovingShardsSuite () {
var cn = "UnitTestMovingShards";
var count = 0;
var c = [];
var dbservers = global.ArangoClusterInfo.getDBServers();
var dbservers = getDBServers();
////////////////////////////////////////////////////////////////////////////////
/// @brief find out servers for a collection
@ -242,7 +252,7 @@ function MovingShardsSuite () {
var request = require("@arangodb/request");
var endpointToURL = require("@arangodb/cluster").endpointToURL;
var url = endpointToURL(coordEndpoint);
var numberOfDBServers = global.ArangoClusterInfo.getDBServers().length;
var numberOfDBServers = servers.length;
var body = {"cleanedServers":[], "numberOfDBServers":numberOfDBServers};
try {
var res = request({ method: "PUT",
@ -378,7 +388,7 @@ function MovingShardsSuite () {
////////////////////////////////////////////////////////////////////////////////
testSetup : function () {
dbservers = global.ArangoClusterInfo.getDBServers();
dbservers = getDBServers();
assertTrue(waitForSynchronousReplication("_system"));
},
@ -388,7 +398,7 @@ function MovingShardsSuite () {
testShrinkNoReplication : function() {
assertTrue(waitForSynchronousReplication("_system"));
var _dbservers = global.ArangoClusterInfo.getDBServers();
var _dbservers = servers;
_dbservers.sort();
assertTrue(shrinkCluster(4));
assertTrue(testServerEmpty(_dbservers[4], true));