aheckmann / gridfs-stream

Easily stream files to and from MongoDB
MIT License
615 stars 120 forks source link

tests fail when run in isolation #68

Open thomas-riccardi opened 9 years ago

thomas-riccardi commented 9 years ago
$ mocha --grep 'instance of Stream'

  test
    GridWriteStream
      ✓ should be an instance of Stream 
      ✓ should be an instance of Stream.Writable 
    GridReadStream
      ✓ should create an instance of Stream 
    1) "after all" hook

  3 passing (272ms)
  1 failing

  1) test "after all" hook:
     Uncaught Error
    at Error.MongoError (/home/riccar
  i/tmp/nodejs/test/node_modules/gridfs-stream/node_modules/mongodb/node_modules/mongodb-core/lib/error.js:13:17)
      at /home/riccardi/tmp/nodejs/test/node_modules/gridfs-stream/node_modules/mongodb/lib/gridfs/grid_store.js:771:23
      at handleCallback (/home/riccardi/tmp/nodejs/test/node_modules/gridfs-stream/node_modules/mongodb/lib/utils.js:93:12)
      at /home/riccardi/tmp/nodejs/test/node_modules/gridfs-stream/node_modules/mongodb/lib/collection.js:846:5
      at handleCallback (/home/riccardi/tmp/nodejs/test/node_modules/gridfs-stream/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:234:5)
      at setCursorNotified (/home/riccardi/tmp/nodejs/test/node_modules/gridfs-stream/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:424:3)
      at /home/riccardi/tmp/nodejs/test/node_modules/gridfs-stream/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:527:16
      at queryCallback (/home/riccardi/tmp/nodejs/test/node_modules/gridfs-stream/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:215:5)
      at Callbacks.emit (/home/riccardi/tmp/nodejs/test/node_modules/gridfs-stream/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:84:3)
      at null.messageHandler (/home/riccardi/tmp/nodejs/test/node_modules/gridfs-stream/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:209:23)
      at Socket.<anonymous> (/home/riccardi/tmp/nodejs/test/node_modules/gridfs-stream/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:256:22)
      at Socket.emit (events.js:95:17)
      at Socket.<anonymous> (_stream_readable.js:764:14)
      at Socket.emit (events.js:92:17)
      at emitReadable_ (_stream_readable.js:426:10)
      at emitReadable (_stream_readable.js:422:5)
      at readableAddChunk (_stream_readable.js:165:9)
      at Socket.Readable.push (_stream_readable.js:127:10)
      at TCP.onread (net.js:528:21)

It does work without --grep. It seems to be related to pending opened GridStore files, but I wasn't able to easily fix this...