mirror of https://gitee.com/bigwinds/arangodb
Broken client API and server default was wrong (#3748)
This commit is contained in:
parent
ecb18dfded
commit
ce537af092
|
@ -357,6 +357,11 @@ ArangoDatabase.prototype._create = function (name, properties, type, options) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof type === 'object') {
|
||||||
|
options = type;
|
||||||
|
type = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
let urlAddons = [];
|
let urlAddons = [];
|
||||||
if (typeof options === "object" && options !== null) {
|
if (typeof options === "object" && options !== null) {
|
||||||
if (options.hasOwnProperty('waitForSyncReplication')) {
|
if (options.hasOwnProperty('waitForSyncReplication')) {
|
||||||
|
|
|
@ -374,8 +374,7 @@ function ClusterCollectionSuite () {
|
||||||
/// @brief test create
|
/// @brief test create
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
testCreateInsufficientDBServers : function () {
|
testCreateInsufficientDBServersDefault : function () {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
db._create("bigreplication", {replicationFactor: 8});
|
db._create("bigreplication", {replicationFactor: 8});
|
||||||
fail();
|
fail();
|
||||||
|
@ -386,6 +385,32 @@ function ClusterCollectionSuite () {
|
||||||
db._drop('bigreplication');
|
db._drop('bigreplication');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief test create
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
testCreateInsufficientDBServersIgnoreReplicationFactor : function () {
|
||||||
|
// should not throw (just a warning)
|
||||||
|
db._create("bigreplication", {replicationFactor: 8}, {enforceReplicationFactor: false});
|
||||||
|
db._drop('bigreplication');
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief test create
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
testCreateInsufficientDBServersEnforceReplicationFactor : function () {
|
||||||
|
try {
|
||||||
|
db._create("bigreplication", {replicationFactor: 8}, {enforceReplicationFactor: true});
|
||||||
|
fail();
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
assertEqual(ERRORS.ERROR_CLUSTER_INSUFFICIENT_DBSERVERS.code, err.errorNum);
|
||||||
|
}
|
||||||
|
db._drop('bigreplication');
|
||||||
|
},
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief test creation / deleting of documents with replication set
|
/// @brief test creation / deleting of documents with replication set
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue