mirror of https://gitee.com/bigwinds/arangodb
Wait for 5 dbservers in resilience tests. (#7545)
This commit is contained in:
parent
04ff42c7c0
commit
c92035fa00
|
@ -476,8 +476,16 @@ function MovingShardsSuite () {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
testSetup : function () {
|
||||
dbservers = getDBServers();
|
||||
assertTrue(waitForSynchronousReplication("_system"));
|
||||
for (var count = 0; count < 120; ++count) {
|
||||
dbservers = getDBServers();
|
||||
if (dbservers.length === 5) {
|
||||
assertTrue(waitForSynchronousReplication("_system"));
|
||||
return;
|
||||
}
|
||||
console.log("Waiting for 5 dbservers to be present:", JSON.stringify(dbservers));
|
||||
wait(1.0);
|
||||
}
|
||||
assertTrue(false, "Timeout waiting for 5 dbservers.");
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -38,6 +38,15 @@ const wait = require("internal").wait;
|
|||
const suspendExternal = require("internal").suspendExternal;
|
||||
const continueExternal = require("internal").continueExternal;
|
||||
|
||||
function getDBServers() {
|
||||
var tmp = global.ArangoClusterInfo.getDBServers();
|
||||
var servers = [];
|
||||
for (var i = 0; i < tmp.length; ++i) {
|
||||
servers[i] = tmp[i].serverId;
|
||||
}
|
||||
return servers;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief test suite
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -393,7 +402,16 @@ function SynchronousReplicationSuite () {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
testSetup : function () {
|
||||
assertTrue(waitForSynchronousReplication("_system"));
|
||||
for (var count = 0; count < 120; ++count) {
|
||||
let dbservers = getDBServers();
|
||||
if (dbservers.length === 5) {
|
||||
assertTrue(waitForSynchronousReplication("_system"));
|
||||
return;
|
||||
}
|
||||
console.log("Waiting for 5 dbservers to be present:", JSON.stringify(dbservers));
|
||||
wait(1.0);
|
||||
}
|
||||
assertTrue(false, "Timeout waiting for 5 dbservers.");
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -33,6 +33,16 @@ const wait = require("internal").wait;
|
|||
const request = require('@arangodb/request');
|
||||
const suspendExternal = require("internal").suspendExternal;
|
||||
const continueExternal = require("internal").continueExternal;
|
||||
|
||||
function getDBServers() {
|
||||
var tmp = global.ArangoClusterInfo.getDBServers();
|
||||
var servers = [];
|
||||
for (var i = 0; i < tmp.length; ++i) {
|
||||
servers[i] = tmp[i].serverId;
|
||||
}
|
||||
return servers;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief test suite
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -317,7 +327,16 @@ function SynchronousReplicationSuite() {
|
|||
/// @brief check if a synchronously replicated collection gets online
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
testSetup: function () {
|
||||
assertTrue(waitForSynchronousReplication("_system"));
|
||||
for (var count = 0; count < 120; ++count) {
|
||||
let dbservers = getDBServers();
|
||||
if (dbservers.length === 5) {
|
||||
assertTrue(waitForSynchronousReplication("_system"));
|
||||
return;
|
||||
}
|
||||
console.log("Waiting for 5 dbservers to be present:", JSON.stringify(dbservers));
|
||||
wait(1.0);
|
||||
}
|
||||
assertTrue(false, "Timeout waiting for 5 dbservers.");
|
||||
},
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief fail in place 1
|
||||
|
|
Loading…
Reference in New Issue