diff options
author | Eric Milkie <milkie@10gen.com> | 2015-03-19 15:00:12 -0400 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2015-03-19 15:01:41 -0400 |
commit | b9b1c95520824c377b4c800e6193d9855be1e14d (patch) | |
tree | 54a1fddd8b5b7cce2c418921764f49e78fa4d4a9 /jstests/disk | |
parent | eac8d16add28e197df59bf5fbfd45fa39b9737f7 (diff) | |
download | mongo-b9b1c95520824c377b4c800e6193d9855be1e14d.tar.gz |
SERVER-17652 open sockets before initializing storage engine
Diffstat (limited to 'jstests/disk')
-rw-r--r-- | jstests/disk/too_many_fds.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/jstests/disk/too_many_fds.js b/jstests/disk/too_many_fds.js new file mode 100644 index 00000000000..f714d495d7c --- /dev/null +++ b/jstests/disk/too_many_fds.js @@ -0,0 +1,22 @@ +// Create more than 1024 files on certain storage engines, then restart the server and see that it +// can still listen on fd's smaller than FD_SETSIZE. + +(function() { +var baseName = "jstests_disk_too_many_fds"; + +var m = MongoRunner.runMongod( { smallfiles: "" , nssize: 1 } ); +// Make 1026 collections, each in a separate database. On some storage engines, this may cause +// 1026 files to be created. +for (var i = 1; i < 1026; ++i) { + var db = m.getDB("db" + i); + var coll = db.getCollection("coll" + i); + assert.writeOK(coll.insert( {} )); +} + +MongoRunner.stopMongod( m ); + +// Ensure we can still start up with that many files. +var m2 = MongoRunner.runMongod( { dbpath: m.dbpath, smallfiles: "" , nssize: 1, + restart: true, cleanData: false } ); +assert.eq(1, m2.getDB("db1025").getCollection("coll1025").count()); +}()); |