         { operation: 'apply', name: 'Added', aggregate: 'sum', attribute: 'added' }
         { operation: 'combine', combine: 'slice', sort: { compare: 'natural', prop: 'Time', direction: 'ascending' } }
       ]
-    }
-
-  describe "[cache tests on] filter; split time; apply count", ->
-    before -> allowQuery = false
+
+    before (done) ->
+      driverFns.mySqlCached(setUpQuery, (err, result) ->
+        throw err if err?
+        allowQuery = false
+        done()
+        return
+      )
+
     after -> allowQuery = true
 
     describe "filter; split time; apply count; apply added", ->

      { operation: 'combine', combine: 'slice', sort: { compare: 'natural', prop: 'Count', direction: 'descending' }, limit: 5 }
    ]

    testQuery = [
      { operation: 'filter', type: 'and', filters: [
        { operation: 'filter', attribute: 'language', type: 'is', value: 'en' }
        { operation: 'filter', type:'within', attribute:'time', range: [ new Date(Date.UTC(2013, 2-1, 26, 0, 0, 0)), new Date(Date.UTC(2013, 2-1, 27, 0, 0, 0))] }
      ]}
      { operation: 'apply', name: 'Count', aggregate: 'sum', attribute: 'count' }
      { operation: 'apply', name: 'Added', aggregate: 'sum', attribute: 'added' }
    ]

    before (done) ->
      driverFns.mySqlCached(setUpQuery, (err, result) ->
        throw err if err?
        allowQuery = false
        console.log(JSON.stringify(result, null, 2))
        done()
        return
      )

      ]
    }

  describe 'topN Cache', ->
    setUpQuery = [
        { operation: 'filter', type:'within', attribute:'time', range: [ new Date(Date.UTC(2013, 2-1, 26, 0, 0, 0)), new Date(Date.UTC(2013, 2-1, 27, 0, 0, 0))] }
        { operation: 'split', name: 'Page', bucket: 'identity', attribute: 'namespace' }
        { operation: 'apply', name: 'Count', aggregate: 'sum', attribute: 'count' }
        { operation: 'apply', name: 'Deleted', aggregate: 'sum', attribute: 'deleted' }
        { operation: 'combine', combine: 'slice', sort: { compare: 'natural', prop: 'Deleted', direction: 'descending' }, limit: 5 }
      ]

    before (done) ->
      driverFns.mySqlCached(setUpQuery, (err, result) ->
        throw err if err?
        allowQuery = false
        done()
        return
      )

    after -> allowQuery = true

    describe "split page; apply deleted; combine descending", ->
