Skip to content

Commit

Permalink
Test fixes and upgraded topology manager
Browse files Browse the repository at this point in the history
  • Loading branch information
christkv committed Jan 3, 2017
1 parent 8f768ef commit 2bb9a7b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 14 deletions.
8 changes: 8 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2.2.17 2017-01-02
-----------------
* updated createCollection doc options and linked to create command.
* Updated mongodb-core to 2.1.3.
* Monitoring operations are re-scheduled in pool if it cannot find a connection that does not already have scheduled work on it, this is to avoid the monitoring socket timeout being applied to any existing operations on the socket due to pipelining
* Moved replicaset monitoring away from serial mode and to parallel mode.
* updated bson and bson-ext dependencies to 1.0.2.

2.2.16 2016-12-13
-----------------
* NODE-899 reversed upsertedId change to bring back old behavior.
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongodb",
"version": "2.2.16",
"version": "2.2.17",
"description": "The official MongoDB driver for Node.js",
"main": "index.js",
"repository": {
Expand All @@ -14,8 +14,7 @@
],
"dependencies": {
"es6-promise": "3.2.1",
"mongodb-core": "2.1.2",
"mongodb-core": "christkv/mongodb-core#2.0",
"mongodb-core": "2.1.3",
"readable-stream": "2.1.5"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/authentication_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ var shardedManager;

var setUpSharded = function(configuration, options, callback) {
// var ShardingManager = require('mongodb-tools').ShardingManager
var ShardingManager = require('../test_topologies').Sharded
var ShardingManager = require('../topology_test_definitions').Sharded
, Db = configuration.require.Db
, Server = configuration.require.Server
, MongoClient = configuration.require.MongoClient
Expand Down
8 changes: 4 additions & 4 deletions test/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var argv = require('optimist')
// MongoDB Topology Manager
var ServerManager = require('mongodb-topology-manager').Server,
ReplSetManager = require('mongodb-topology-manager').ReplSet,
ShardingManager = require('./test_topologies.js').Sharded;
ShardingManager = require('./topology_test_definitions.js').Sharded;

// Skipping parameters
var startupOptions = {
Expand Down Expand Up @@ -130,13 +130,13 @@ var Configuration = function(options) {
});
});
}).catch(function(err) {
// console.log(err.stack);
console.log(err.stack);
});
}).catch(function(err) {
// console.log(err.stack);
console.log(err.stack);
});
}).catch(function(err) {
// console.log(err.stack);
console.log(err.stack);
});
},

Expand Down
21 changes: 15 additions & 6 deletions test/test_topologies.js → test/topology_test_definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@ var P = global.Promise || require('es6-promise'),
f = require('util').format;

var Sharded = function(options, clientOptions) {
// console.log("================= ShardingManager 0")
this.topology = new ShardingManager({
mongod: 'mongod',
mongos: 'mongos'
});

// console.log("================= ShardingManager")
// console.dir(this.topology)

// this.topology.on('state', function(state) {
// console.log("========= received state")
// console.dir(state)
// })

// Additional options needed
this.options = options || {};
this.clientOptions = clientOptions || {};
Expand All @@ -25,19 +34,19 @@ Sharded.prototype.start = function(callback) {
var nodes1 = [{
tags: {"loc":"ny"},
options: {
bind_ip: 'localhost', port: 31010, dbpath: f('%s/../db/31000', __dirname)
bind_ip: 'localhost', port: 31010, dbpath: f('%s/../db/31000', __dirname), shardsvr:null
}
}, {
tags: {"loc":"sf"},
options: {
bind_ip: 'localhost', port: 31011, dbpath: f('%s/../db/31001', __dirname)
bind_ip: 'localhost', port: 31011, dbpath: f('%s/../db/31001', __dirname), shardsvr:null
}
}, {
// Type of node
arbiter: true,
// mongod process options
options: {
bind_ip: 'localhost', port: 31012, dbpath: f('%s/../db/31002', __dirname)
bind_ip: 'localhost', port: 31012, dbpath: f('%s/../db/31002', __dirname), shardsvr:null
}
}];

Expand All @@ -59,19 +68,19 @@ Sharded.prototype.start = function(callback) {
var nodes2 = [{
tags: {"loc":"ny"},
options: {
bind_ip: 'localhost', port: 31020, dbpath: f('%s/../db/31010', __dirname)
bind_ip: 'localhost', port: 31020, dbpath: f('%s/../db/31010', __dirname), shardsvr:null
}
}, {
tags: {"loc":"sf"},
options: {
bind_ip: 'localhost', port: 31021, dbpath: f('%s/../db/31011', __dirname)
bind_ip: 'localhost', port: 31021, dbpath: f('%s/../db/31011', __dirname), shardsvr:null
}
}, {
// Type of node
arbiter: true,
// mongod process options
options: {
bind_ip: 'localhost', port: 31022, dbpath: f('%s/../db/31012', __dirname)
bind_ip: 'localhost', port: 31022, dbpath: f('%s/../db/31012', __dirname), shardsvr:null
}
}];

Expand Down

0 comments on commit 2bb9a7b

Please sign in to comment.