title: redis hash command hang while async callback is present Node.js
body: <p>My goal is to have integration test that tests a Node Module which saves values in the redis. Here is the test:</p>
  
  <pre><code>require('coffee-script');
  var should = require('should')
      , redis = require('redis')
      , async = require('async')
      , Domain = require('../index');
  
  async.series([
      function(callback){
          db = redis.createClient();
          callback(null,'zero');
      },
      function(callback){
          db.flushdb( function (err, didSucceed) {
              if(err){
                  console.log('error: ' + err.message);
                  callback(err, 'one');
              }
          });
          callback(null, 'one');
      },
      function(callback){
          should.exist(Domain);
  
          domain = new Domain({'attOne':1, 'attTwo':2, 'id':1});
  
          domain.should.have.property('save');
          domain.should.have.property('attOne');
          domain.should.have.property('attTwo');
  
          domain.save.should.be.an.instanceof(Function);
          callback(null, 'two');
      },
      function(){
          db.end();
      }
  ],
      function(err, results){
          if(err){
             console.log('error encountered: ' + err.message);
             db.end();
          }
          console.log('All tests passed');
      }
  );
  </code></pre>
  
  <p>With this test, the problem is that the redis connection is closed before the redis flushes the the database(If i remove the db.end() at all, the test hangs but the redis db is flushed). Apparently, the async.series is not working as i expect it where every function is run before the next one in a serial order or i am misunderstanding? how to ensure this test executes in serial flow so redis connection is not closed before the flush? ...any recommendations of any libraries/frameworks that could help me on what i am trying to accomplish here? Thank You</p>