1
0
Fork 0

Test code for sync. replication.

This commit is contained in:
Max Neunhoeffer 2016-05-31 01:14:02 -06:00
parent c36e2c42ad
commit 6e984b8411
1 changed files with 47 additions and 21 deletions

View File

@ -77,7 +77,7 @@ function SynchronousReplicationSuite () {
); );
let replicas = ccinfo.map(s => s.servers.length); let replicas = ccinfo.map(s => s.servers.length);
if (_.all(replicas, x => x === 2)) { if (_.all(replicas, x => x === 2)) {
console.info("Replication up and running!"); console.warn("Replication up and running!");
return true; return true;
} }
wait(0.5); wait(0.5);
@ -98,6 +98,7 @@ function SynchronousReplicationSuite () {
x => x.endpoint === endpoint); x => x.endpoint === endpoint);
assertTrue(pos >= 0); assertTrue(pos >= 0);
assertTrue(suspendExternal(global.instanceInfo.arangods[pos].pid)); assertTrue(suspendExternal(global.instanceInfo.arangods[pos].pid));
console.warn("Have failed follower", follower);
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -112,6 +113,7 @@ function SynchronousReplicationSuite () {
x => x.endpoint === endpoint); x => x.endpoint === endpoint);
assertTrue(pos >= 0); assertTrue(pos >= 0);
assertTrue(continueExternal(global.instanceInfo.arangods[pos].pid)); assertTrue(continueExternal(global.instanceInfo.arangods[pos].pid));
console.warn("Have healed follower", follower);
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -126,6 +128,7 @@ function SynchronousReplicationSuite () {
x => x.endpoint === endpoint); x => x.endpoint === endpoint);
assertTrue(pos >= 0); assertTrue(pos >= 0);
assertTrue(suspendExternal(global.instanceInfo.arangods[pos].pid)); assertTrue(suspendExternal(global.instanceInfo.arangods[pos].pid));
console.warn("Have failed leader", leader);
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -140,6 +143,7 @@ function SynchronousReplicationSuite () {
x => x.endpoint === endpoint); x => x.endpoint === endpoint);
assertTrue(pos >= 0); assertTrue(pos >= 0);
assertTrue(continueExternal(global.instanceInfo.arangods[pos].pid)); assertTrue(continueExternal(global.instanceInfo.arangods[pos].pid));
console.warn("Have healed leader", leader);
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -332,6 +336,7 @@ function SynchronousReplicationSuite () {
/// @brief check whether we have access to global.instanceInfo /// @brief check whether we have access to global.instanceInfo
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/*
testCheckInstanceInfo : function () { testCheckInstanceInfo : function () {
assertTrue(global.instanceInfo !== undefined); assertTrue(global.instanceInfo !== undefined);
}, },
@ -534,12 +539,11 @@ function SynchronousReplicationSuite () {
runBasicOperations({place:17, follower:true}, {place:17, follower:true}); runBasicOperations({place:17, follower:true}, {place:17, follower:true});
assertTrue(waitForSynchronousReplication("_system")); assertTrue(waitForSynchronousReplication("_system"));
}, },
*/
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief run a standard check with failures: /// @brief run a standard check with failures:
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/*
testBasicOperationsFailureLeader : function () { testBasicOperationsFailureLeader : function () {
assertTrue(waitForSynchronousReplication("_system")); assertTrue(waitForSynchronousReplication("_system"));
failLeader(); failLeader();
@ -547,7 +551,29 @@ function SynchronousReplicationSuite () {
healLeader(); healLeader();
assertTrue(waitForSynchronousReplication("_system")); assertTrue(waitForSynchronousReplication("_system"));
}, },
*/
////////////////////////////////////////////////////////////////////////////////
/// @brief fail leader in place 1
////////////////////////////////////////////////////////////////////////////////
testBasicOperationsLeaderFail1 : function () {
assertTrue(waitForSynchronousReplication("_system"));
runBasicOperations({place:1, follower: false},
{place:17, follower: false});
assertTrue(waitForSynchronousReplication("_system"));
},
////////////////////////////////////////////////////////////////////////////////
/// @brief fail leader in place 17
////////////////////////////////////////////////////////////////////////////////
testBasicOperationsLeaderFail17 : function () {
assertTrue(waitForSynchronousReplication("_system"));
runBasicOperations({place:17, follower: false},
{place:17, follower: false});
assertTrue(waitForSynchronousReplication("_system"));
},
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief just to allow a trailing comma at the end of the last test /// @brief just to allow a trailing comma at the end of the last test
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////