1
0
Fork 0

Fix agency test startup. (#4643)

This commit is contained in:
Max Neunhöffer 2018-03-01 16:45:47 +01:00 committed by GitHub
parent 8c1eccff33
commit 897e31657d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 8 deletions

View File

@ -75,14 +75,24 @@ function agencyTestSuite () {
var request = require("@arangodb/request");
function findAgencyCompactionIntervals() {
let res = request({url: agencyLeader + "/_api/agency/config",
method: "GET", followRedirect: true});
assertEqual(res.statusCode, 200);
res.bodyParsed = JSON.parse(res.body);
return {
compactionStepSize: res.bodyParsed.configuration["compaction step size"],
compactionKeepSize: res.bodyParsed.configuration["compaction keep size"]
};
for (let count = 0; count < 60; ++count) {
let res = request({url: agencyLeader + "/_api/agency/config",
method: "GET", followRedirect: true});
if (res.statusCode === 200) {
res.bodyParsed = JSON.parse(res.body);
return {
compactionStepSize: res.bodyParsed.configuration["compaction step size"],
compactionKeepSize: res.bodyParsed.configuration["compaction keep size"]
};
}
require('console').topic("agency=warn", "Got status " + res.statusCode +
" from agency.");
require("internal").wait(1.0); // give the server another second
}
require('console').topic("agency=error",
"Giving up, agency did not boot successfully.");
assertEqual("apple", "orange");
// all is lost because agency did not get up and running in time
}
var compactionConfig = findAgencyCompactionIntervals();