 describe "redis-reservation", ->
 
   before (done) ->
-    @redis = redis.createClient()  # localhost
+    @redis = redis.createClient(process.env.REDIS_PORT, process.env.REDIS_HOST)
     #@redis.select 3
     done()
 


class FailWorker extends BaseWorker
  @_name: 'fail_worker'
  _exit_on_throw: false
  _run: (payload, cb) =>
    throw new Error(":(")
    cb("done_after_error")

class SlowWorker extends BaseWorker
  @_name: 'slow_worker'
  _exit_on_throw: false
  _hearbeat_interval: 500
  _lock_ttl: 1
  _run: (payload, cb) ->

  _run: (payload, cb) -> cb new Error "must implement _run"
  _hearbeat_interval: 10*60*1000  # 10 minutes in milliseconds for resource reservation
  _lock_ttl: 30*60  # 30 minutes in seconds for resource reservation

class LockWorker extends BaseWorker
  @_name: 'test_worker'
