             lock2.releaseLock().on 'released', (ld) ->
               assert ld?
               order += '2'
+              assert.equal order, expectedOrder
+              done()
         ).once('write-req-set', () ->
             lock3.obtainReadLock().on 'locked', (ld) ->
               assert ld?

              lock3.releaseLock().on 'released', (ld) ->
                assert ld?
                order += '3'
                assert.equal order, expectedOrder
                done()
            lock1.releaseLock().on 'released', (ld) ->
              assert ld?
              order += '1')

              assert ld?
              order += '1')

    it "should give priority to a read request waiting on a write lock over a subsequent write request", (done) ->
      expectedOrder = "113322"
      order = ''
      lock1.obtainWriteLock().on 'locked', (ld) ->
        assert ld?
