         messages = $history.find('.message-text').text()
         return messages if messages.length > 0
 
-      return zc.waitfor(2000, get_messages)
+      return zc.waitfor(get_messages, 3000)
     .then (messages) ->
       expect(messages).toEqual("hello world")
     .catch (err) ->

zc.waitfor = (timeout, check) ->
  t0 = _.now()
  deferred = Q.defer()


      clearInterval(interval)
      deferred.resolve(rv)

  interval = setInterval(poll, 50)

  return deferred.promise

