mirror of https://gitee.com/bigwinds/arangodb
Made replication-static test aware of MMFiles and gnore their options.
This commit is contained in:
parent
db26fe0061
commit
3b364897a1
|
@ -38,6 +38,7 @@ var console = require("console");
|
||||||
var internal = require("internal");
|
var internal = require("internal");
|
||||||
var masterEndpoint = arango.getEndpoint();
|
var masterEndpoint = arango.getEndpoint();
|
||||||
var slaveEndpoint = ARGUMENTS[0];
|
var slaveEndpoint = ARGUMENTS[0];
|
||||||
|
var mmfilesEngine = (db._engine().name === "mmfiles");
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief test suite
|
/// @brief test suite
|
||||||
|
@ -1158,11 +1159,13 @@ function ReplicationSuite() {
|
||||||
var properties = db._collection(cn2).properties();
|
var properties = db._collection(cn2).properties();
|
||||||
assertEqual(state.cid, db._collection(cn2)._id);
|
assertEqual(state.cid, db._collection(cn2)._id);
|
||||||
assertEqual(cn2, db._collection(cn2).name());
|
assertEqual(cn2, db._collection(cn2).name());
|
||||||
assertTrue(properties.isVolatile);
|
if (mmfilesEngine) {
|
||||||
|
assertTrue(properties.isVolatile);
|
||||||
|
assertFalse(properties.doCompact);
|
||||||
|
assertEqual(1048576, properties.journalSize);
|
||||||
|
}
|
||||||
assertFalse(properties.waitForSync);
|
assertFalse(properties.waitForSync);
|
||||||
assertFalse(properties.deleted);
|
assertFalse(properties.deleted);
|
||||||
assertFalse(properties.doCompact);
|
|
||||||
assertEqual(1048576, properties.journalSize);
|
|
||||||
assertFalse(properties.keyOptions.allowUserKeys);
|
assertFalse(properties.keyOptions.allowUserKeys);
|
||||||
assertEqual("traditional", properties.keyOptions.type);
|
assertEqual("traditional", properties.keyOptions.type);
|
||||||
}
|
}
|
||||||
|
@ -1212,8 +1215,10 @@ function ReplicationSuite() {
|
||||||
|
|
||||||
var properties = c.properties();
|
var properties = c.properties();
|
||||||
assertFalse(properties.waitForSync);
|
assertFalse(properties.waitForSync);
|
||||||
assertFalse(properties.doCompact);
|
if (mmfilesEngine) {
|
||||||
assertEqual(1048576, properties.journalSize);
|
assertFalse(properties.doCompact);
|
||||||
|
assertEqual(1048576, properties.journalSize);
|
||||||
|
}
|
||||||
|
|
||||||
properties = c.properties({
|
properties = c.properties({
|
||||||
waitForSync: true,
|
waitForSync: true,
|
||||||
|
@ -1221,9 +1226,11 @@ function ReplicationSuite() {
|
||||||
journalSize: 2097152
|
journalSize: 2097152
|
||||||
});
|
});
|
||||||
assertTrue(properties.waitForSync);
|
assertTrue(properties.waitForSync);
|
||||||
assertTrue(properties.doCompact);
|
if (mmfilesEngine) {
|
||||||
assertEqual(2097152, properties.journalSize);
|
assertTrue(properties.doCompact);
|
||||||
assertTrue(properties.hasOwnProperty("indexBuckets"));
|
assertEqual(2097152, properties.journalSize);
|
||||||
|
assertTrue(properties.hasOwnProperty("indexBuckets"));
|
||||||
|
}
|
||||||
|
|
||||||
state.cid = c._id;
|
state.cid = c._id;
|
||||||
state.properties = c.properties();
|
state.properties = c.properties();
|
||||||
|
@ -1233,10 +1240,12 @@ function ReplicationSuite() {
|
||||||
assertEqual(state.cid, db._collection(cn)._id);
|
assertEqual(state.cid, db._collection(cn)._id);
|
||||||
assertEqual(cn, db._collection(cn).name());
|
assertEqual(cn, db._collection(cn).name());
|
||||||
assertTrue(properties.waitForSync);
|
assertTrue(properties.waitForSync);
|
||||||
assertTrue(properties.doCompact);
|
if (mmfilesEngine) {
|
||||||
assertEqual(2097152, properties.journalSize);
|
assertTrue(properties.doCompact);
|
||||||
assertTrue(properties.hasOwnProperty("indexBuckets"));
|
assertEqual(2097152, properties.journalSize);
|
||||||
assertEqual(properties.indexBuckets, properties.indexBuckets);
|
assertTrue(properties.hasOwnProperty("indexBuckets"));
|
||||||
|
assertEqual(properties.indexBuckets, properties.indexBuckets);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -1256,8 +1265,10 @@ function ReplicationSuite() {
|
||||||
|
|
||||||
var properties = c.properties();
|
var properties = c.properties();
|
||||||
assertTrue(properties.waitForSync);
|
assertTrue(properties.waitForSync);
|
||||||
assertTrue(properties.doCompact);
|
if (mmfilesEngine) {
|
||||||
assertEqual(2097152, properties.journalSize);
|
assertTrue(properties.doCompact);
|
||||||
|
assertEqual(2097152, properties.journalSize);
|
||||||
|
}
|
||||||
|
|
||||||
properties = c.properties({
|
properties = c.properties({
|
||||||
waitForSync: false,
|
waitForSync: false,
|
||||||
|
@ -1265,9 +1276,11 @@ function ReplicationSuite() {
|
||||||
journalSize: 1048576
|
journalSize: 1048576
|
||||||
});
|
});
|
||||||
assertFalse(properties.waitForSync);
|
assertFalse(properties.waitForSync);
|
||||||
assertFalse(properties.doCompact);
|
if (mmfilesEngine) {
|
||||||
assertEqual(1048576, properties.journalSize);
|
assertFalse(properties.doCompact);
|
||||||
assertTrue(properties.hasOwnProperty("indexBuckets"));
|
assertEqual(1048576, properties.journalSize);
|
||||||
|
assertTrue(properties.hasOwnProperty("indexBuckets"));
|
||||||
|
}
|
||||||
|
|
||||||
state.cid = c._id;
|
state.cid = c._id;
|
||||||
state.properties = c.properties();
|
state.properties = c.properties();
|
||||||
|
@ -1277,10 +1290,12 @@ function ReplicationSuite() {
|
||||||
assertEqual(state.cid, db._collection(cn)._id);
|
assertEqual(state.cid, db._collection(cn)._id);
|
||||||
assertEqual(cn, db._collection(cn).name());
|
assertEqual(cn, db._collection(cn).name());
|
||||||
assertFalse(properties.waitForSync);
|
assertFalse(properties.waitForSync);
|
||||||
assertFalse(properties.doCompact);
|
if (mmfilesEngine) {
|
||||||
assertEqual(1048576, properties.journalSize);
|
assertFalse(properties.doCompact);
|
||||||
assertTrue(properties.hasOwnProperty("indexBuckets"));
|
assertEqual(1048576, properties.journalSize);
|
||||||
assertEqual(properties.indexBuckets, properties.indexBuckets);
|
assertTrue(properties.hasOwnProperty("indexBuckets"));
|
||||||
|
assertEqual(properties.indexBuckets, properties.indexBuckets);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -1290,28 +1305,30 @@ function ReplicationSuite() {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
testChangeCollectionIndexBuckets: function() {
|
testChangeCollectionIndexBuckets: function() {
|
||||||
compare(
|
if (mmfilesEngine) {
|
||||||
function(state) {
|
compare(
|
||||||
var c = db._create(cn, {
|
function(state) {
|
||||||
indexBuckets: 4
|
var c = db._create(cn, {
|
||||||
});
|
indexBuckets: 4
|
||||||
|
});
|
||||||
|
|
||||||
var properties = c.properties();
|
var properties = c.properties();
|
||||||
assertEqual(4, properties.indexBuckets);
|
assertEqual(4, properties.indexBuckets);
|
||||||
|
|
||||||
properties = c.properties({
|
properties = c.properties({
|
||||||
indexBuckets: 8
|
indexBuckets: 8
|
||||||
});
|
});
|
||||||
assertEqual(8, properties.indexBuckets);
|
assertEqual(8, properties.indexBuckets);
|
||||||
|
|
||||||
state.cid = c._id;
|
state.cid = c._id;
|
||||||
state.properties = c.properties();
|
state.properties = c.properties();
|
||||||
},
|
},
|
||||||
function(state) {
|
function(state) {
|
||||||
var properties = db._collection(cn).properties();
|
var properties = db._collection(cn).properties();
|
||||||
assertEqual(8, properties.indexBuckets);
|
assertEqual(8, properties.indexBuckets);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -1335,14 +1352,16 @@ function ReplicationSuite() {
|
||||||
var properties = db._collection(cn).properties();
|
var properties = db._collection(cn).properties();
|
||||||
assertEqual(state.cid, db._collection(cn)._id);
|
assertEqual(state.cid, db._collection(cn)._id);
|
||||||
assertEqual(cn, db._collection(cn).name());
|
assertEqual(cn, db._collection(cn).name());
|
||||||
assertTrue(properties.isVolatile);
|
|
||||||
assertFalse(properties.waitForSync);
|
assertFalse(properties.waitForSync);
|
||||||
assertFalse(properties.deleted);
|
assertFalse(properties.deleted);
|
||||||
assertFalse(properties.doCompact);
|
if (mmfilesEngine) {
|
||||||
assertEqual(1048576, properties.journalSize);
|
assertTrue(properties.isVolatile);
|
||||||
|
assertFalse(properties.doCompact);
|
||||||
|
assertEqual(1048576, properties.journalSize);
|
||||||
|
assertTrue(properties.hasOwnProperty("indexBuckets"));
|
||||||
|
}
|
||||||
assertTrue(properties.keyOptions.allowUserKeys);
|
assertTrue(properties.keyOptions.allowUserKeys);
|
||||||
assertEqual("traditional", properties.keyOptions.type);
|
assertEqual("traditional", properties.keyOptions.type);
|
||||||
assertTrue(properties.hasOwnProperty("indexBuckets"));
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -1375,11 +1394,13 @@ function ReplicationSuite() {
|
||||||
assertFalse(properties.isVolatile);
|
assertFalse(properties.isVolatile);
|
||||||
assertTrue(properties.waitForSync);
|
assertTrue(properties.waitForSync);
|
||||||
assertFalse(properties.deleted);
|
assertFalse(properties.deleted);
|
||||||
assertTrue(properties.doCompact);
|
if (mmfilesEngine) {
|
||||||
assertEqual(2097152, properties.journalSize);
|
assertTrue(properties.doCompact);
|
||||||
|
assertEqual(2097152, properties.journalSize);
|
||||||
|
assertTrue(properties.hasOwnProperty("indexBuckets"));
|
||||||
|
}
|
||||||
assertFalse(properties.keyOptions.allowUserKeys);
|
assertFalse(properties.keyOptions.allowUserKeys);
|
||||||
assertEqual("autoincrement", properties.keyOptions.type);
|
assertEqual("autoincrement", properties.keyOptions.type);
|
||||||
assertTrue(properties.hasOwnProperty("indexBuckets"));
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -1389,22 +1410,24 @@ function ReplicationSuite() {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
testCreateCollectionIndexBuckets1: function() {
|
testCreateCollectionIndexBuckets1: function() {
|
||||||
compare(
|
if (mmfilesEngine) {
|
||||||
function(state) {
|
compare(
|
||||||
var c = db._create(cn, {
|
function(state) {
|
||||||
indexBuckets: 16
|
var c = db._create(cn, {
|
||||||
});
|
indexBuckets: 16
|
||||||
|
});
|
||||||
|
|
||||||
state.cid = c._id;
|
state.cid = c._id;
|
||||||
state.properties = c.properties();
|
state.properties = c.properties();
|
||||||
},
|
},
|
||||||
function(state) {
|
function(state) {
|
||||||
var properties = db._collection(cn).properties();
|
var properties = db._collection(cn).properties();
|
||||||
assertEqual(state.cid, db._collection(cn)._id);
|
assertEqual(state.cid, db._collection(cn)._id);
|
||||||
assertEqual(cn, db._collection(cn).name());
|
assertEqual(cn, db._collection(cn).name());
|
||||||
assertEqual(16, properties.indexBuckets);
|
assertEqual(16, properties.indexBuckets);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -1412,22 +1435,24 @@ function ReplicationSuite() {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
testCreateCollectionIndexBuckets2: function() {
|
testCreateCollectionIndexBuckets2: function() {
|
||||||
compare(
|
if (mmfilesEngine) {
|
||||||
function(state) {
|
compare(
|
||||||
var c = db._create(cn, {
|
function(state) {
|
||||||
indexBuckets: 8
|
var c = db._create(cn, {
|
||||||
});
|
indexBuckets: 8
|
||||||
|
});
|
||||||
|
|
||||||
state.cid = c._id;
|
state.cid = c._id;
|
||||||
state.properties = c.properties();
|
state.properties = c.properties();
|
||||||
},
|
},
|
||||||
function(state) {
|
function(state) {
|
||||||
var properties = db._collection(cn).properties();
|
var properties = db._collection(cn).properties();
|
||||||
assertEqual(state.cid, db._collection(cn)._id);
|
assertEqual(state.cid, db._collection(cn)._id);
|
||||||
assertEqual(cn, db._collection(cn).name());
|
assertEqual(cn, db._collection(cn).name());
|
||||||
assertEqual(8, properties.indexBuckets);
|
assertEqual(8, properties.indexBuckets);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue