                 assert ld?
                 order += '3'
                 assert.equal order, expectedOrder
-                done());
+                done())
 
     it "should give priority to a write request waiting on a dead write lock over a subsequent read request", (done) ->
       expectedOrder = "12233"

                assert ld?
                order += '3'
                assert.equal order, expectedOrder
                done());

    it "should allow a read request to proceed when a prior write request dies without releasing write_req", (done) ->
      expectedOrder = "1331"
      order = ''
      lock2.timeOut = 100

                  assert ld?
                  order += '1'
                  assert.equal order, expectedOrder
                  done())

    it "should allow a read request to proceed when a prior write request dies without releasing write_req", (done) ->
      expectedOrder = "1331"
      order = ''
      lock2.timeOut = 100
      lock1.lockExpiration = 1000
      lock3.lockExpiration = 1000
      lock1.obtainReadLock().on 'locked', (ld) ->
        assert ld?
        order += '1'
        # set the write_req flag without creating a lock, to simulate a dead write request
        setWriteReq lock2, (err, doc) ->
          assert not err
          lock3.obtainReadLock().on 'locked', (ld) ->
            assert ld?
            order += '3'
            lock3.releaseLock().on 'released', (ld) ->
              assert ld?
              order += '3'
              lock1.releaseLock().on 'released', (ld) ->
                assert ld?
                order += '1'
                assert.equal order, expectedOrder
                done()

    it "should allow a read request to proceed when a prior write request times-out waiting for a write lock", (done) ->
      expectedOrder = "133"
      order = ''
      lock2.timeOut = 100
      lock1.lockExpiration = 1000
      lock1.obtainWriteLock().on 'locked', (ld) ->
        assert ld?
        order += '1'
