Skip to content

Commit

Permalink
trying to fix build by adding delay
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Kliment committed May 22, 2015
1 parent d1cae1b commit 066e417
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/fixtures/ruby-hooks/hooks-worker-client.coffee
Expand Up @@ -37,6 +37,13 @@ worker.stderr.on 'data', (data) ->
worker.on 'error', (error) ->
console.log error

# Wait before connecting to a worker
# Hack for blocking sleep, loading of hooks in dredd is not async
# TODO Move connecting to worker to async beforeAll hook
now = new Date().getTime()
while new Date().getTime() < now + 1000
true

workerClient = net.connect port: WORKER_PORT, host: WORKER_HOST, () ->
# Do something when dredd starts
# message =
Expand Down Expand Up @@ -69,6 +76,7 @@ workerClient.on 'data', (data) ->
else
console.log 'UUID not present in message: ', JSON.stringify(message, null ,2)

# Wait before starting a test
# Hack for blocking sleep, loading of hooks in dredd is not async
# TODO Move connecting to worker to async beforeAll hook
now = new Date().getTime()
Expand Down

0 comments on commit 066e417

Please sign in to comment.