From e2db99c7fd82ed9dc9a857b60c7b8cf461248ac9 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Tue, 5 May 2015 10:06:18 +0200 Subject: [PATCH] Make polling tests more reliable with longer timeouts I was using a very short polling interval of 10ms for testing polling mixin. This lets a little room for any timing problems, which may happen with setTimeout or setInterval. Increasing it to 20ms hopefully can make it more reliable. --- tests/unit/services/polling-test.coffee | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/unit/services/polling-test.coffee b/tests/unit/services/polling-test.coffee index 57bab758..6bbe1ac9 100644 --- a/tests/unit/services/polling-test.coffee +++ b/tests/unit/services/polling-test.coffee @@ -15,7 +15,7 @@ test 'polls for each of the models', -> history = [] service = Polling.create( - pollingInterval: 10 + pollingInterval: 20 ) model1 = { @@ -42,13 +42,13 @@ test 'polls for each of the models', -> Ember.run -> service.destroy() - , 15 + , 30 test 'it will stop running any reloads after it is destroyed', -> expect(1) service = Polling.create( - pollingInterval: 10 + pollingInterval: 20 ) model = { @@ -63,11 +63,11 @@ test 'it will stop running any reloads after it is destroyed', -> setTimeout -> Ember.run -> service.destroy() - , 15 + , 30 setTimeout -> start() - , 30 + , 50 test 'it stops reloading models after they were removed from polling', -> expect(4) @@ -75,7 +75,7 @@ test 'it stops reloading models after they were removed from polling', -> history = [] service = Polling.create( - pollingInterval: 10 + pollingInterval: 30 ) model1 = { @@ -105,8 +105,8 @@ test 'it stops reloading models after they were removed from polling', -> start() deepEqual history, ['model1', 'model2', 'model1'] - , 10 - , 12 + , 30 + , 40 test 'it runs a hook on each interval', -> expect(1) @@ -114,7 +114,7 @@ test 'it runs a hook on each interval', -> history = [] service = Polling.create( - pollingInterval: 10 + pollingInterval: 20 ) source = { @@ -135,7 +135,7 @@ test 'it runs a hook on each interval', -> start() , 10 - , 12 + , 30 test 'it will not run pollHook if the source is destroyed', -> expect(1) @@ -143,7 +143,7 @@ test 'it will not run pollHook if the source is destroyed', -> history = [] service = Polling.create( - pollingInterval: 10 + pollingInterval: 20 ) source = Ember.Object.extend( @@ -164,5 +164,5 @@ test 'it will not run pollHook if the source is destroyed', -> service.destroy() start() - , 30 - , 12 + , 35 + , 30