From f8e9df9130a05e297d0b3bc938a9f21dcc5fdb1d Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Wed, 1 Jun 2016 14:52:35 +0100 Subject: [PATCH] each health check is run with different user_id means can do a full clean after tests --- .../notifications/app/coffee/HealthCheckController.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/notifications/app/coffee/HealthCheckController.coffee b/services/notifications/app/coffee/HealthCheckController.coffee index 626cd02902..52db88518a 100644 --- a/services/notifications/app/coffee/HealthCheckController.coffee +++ b/services/notifications/app/coffee/HealthCheckController.coffee @@ -12,9 +12,9 @@ db = mongojs(Settings.mongo?.url, ['notifications']) module.exports = check : (callback)-> - user_id = ObjectId(settings.notifications.healthCheck.user_id) + user_id = ObjectId() notification_key = "smoke-test-notification-#{ObjectId()}" - getOpts = (endPath)-> {url:"http://localhost:#{port}/user/#{user_id}#{endPath}", timeout:3000} + getOpts = (endPath)-> {url:"http://localhost:#{port}/user/#{user_id}#{endPath}", timeout:5000} logger.log user_id:user_id, opts:getOpts(), key:notification_key, user_id:user_id, "Health Check: running" jobs = [ (cb)-> @@ -59,4 +59,4 @@ module.exports = if err? logger.err err, opts, "Health Check: error cleaning up notification" return callback(err) - db.notifications.remove {_id:ObjectId(notification_id)}, callback + db.notifications.remove {user_id:user_id}, callback