         server = app.listen PORT, () ->
           server2 = apiary.listen (PORT + 1), ->
 
-        wakeUpEventLoop ->
-          execCommand cmd, () ->
-            wakeUpEventLoop ->
-              server2.close ->
-                server.close ->
+        execCommand cmd, () ->
+          server2.close ->
+            server.close ->
 
         server.on 'close', done
 


      server = app.listen PORT, () ->
        server2 = apiary.listen (PORT + 1), ->
          wakeUpEventLoop ->
            execCommand cmd, () ->
              server2.close ->
                server.close () ->
                  done()

    it 'should not print warning about missing APIARY_API_KEY and APIARY_API_NAME', () ->
      assert.notInclude stderr, 'Apiary reporter environment variable APIARY_API_KEY or APIARY_API_NAME not defined.'

          res.send {}

        server2 = apiary.listen (PORT + 1), ->
          execCommand cmd, () ->
            server2.close ->

        server2.on 'close', done

