@@ -127,7 +127,6 @@ def test_update_activities_update(self):
127127 activities_created = self .user1 .add_activities (activities )['activities' ]
128128 activities = copy .deepcopy (activities_created )
129129
130- self ._test_sleep (3 , 0.25 )
131130
132131 for activity in activities :
133132 activity .pop ('id' )
@@ -245,7 +244,6 @@ def test_add_activity_to_inplace_change(self):
245244 activity_data ['to' ] = [team_feed .id ]
246245 feed .add_activity (activity_data )
247246
248- self ._test_sleep (2 , 0.25 )
249247
250248 self .assertEqual (activity_data ['to' ], [team_feed .id ])
251249
@@ -256,7 +254,6 @@ def test_add_activities_to_inplace_change(self):
256254 activity_data ['to' ] = [team_feed .id ]
257255 feed .add_activities ([activity_data ])
258256
259- self ._test_sleep (2 , 0.25 )
260257
261258 self .assertEqual (activity_data ['to' ], [team_feed .id ])
262259
@@ -272,7 +269,6 @@ def test_add_activity_to(self):
272269 response = user_feed .add_activity (activity_data )
273270 activity_id = response ['id' ]
274271
275- self ._test_sleep (2 , 0.25 )
276272
277273 # see if the new activity is also in the team feed
278274 activities = team_feed .get (limit = 1 )['results' ]
@@ -318,7 +314,6 @@ def test_remove_activity(self):
318314 activity_data = {'actor' : 1 , 'verb' : 'tweet' , 'object' : 1 }
319315 activity_id = self .user1 .add_activity (activity_data )['id' ]
320316 self .user1 .remove_activity (activity_id )
321- self ._test_sleep (10 , 0.25 )
322317 activities = self .user1 .get (limit = 1 )['results' ]
323318 self .assertNotEqual (activities [0 ]['id' ], activity_id )
324319
@@ -327,7 +322,6 @@ def test_remove_activity_by_foreign_id(self):
327322 'actor' : 1 , 'verb' : 'tweet' , 'object' : 1 , 'foreign_id' : 'tweet:10' }
328323 activity_id = self .user1 .add_activity (activity_data )['id' ]
329324 self .user1 .remove_activity (foreign_id = 'tweet:10' )
330- self ._test_sleep (10 , 0.25 )
331325 activities = self .user1 .get (limit = 1 )['results' ]
332326 self .assertNotEqual (activities [0 ]['id' ], activity_id )
333327 # verify this doesnt raise an error, but fails silently
@@ -374,7 +368,6 @@ def test_follow_and_source(self):
374368 activity_id = feed .add_activity (activity_data )['id' ]
375369 agg_feed .follow (feed .slug , feed .user_id )
376370
377- self ._test_sleep (5 , 0.1 )
378371
379372 activities = agg_feed .get (limit = 3 )['results' ]
380373 activity = self ._get_first_aggregated_activity (activities )
@@ -389,7 +382,6 @@ def test_follow_activity_copy_limit(self):
389382 feed1 .add_activity ({ 'actor' : actor_id , 'verb' : 'tweet' , 'object' : 1 })
390383 feed .follow (feed1 .slug , feed1 .user_id , activity_copy_limit = 0 )
391384
392- self ._test_sleep (5 , 0.25 )
393385
394386 activities = feed .get (limit = 5 )['results' ]
395387
@@ -402,23 +394,14 @@ def test_follow_and_delete(self):
402394 activity_data = {'actor' : actor_id , 'verb' : 'tweet' , 'object' : 1 }
403395 activity_id = user_feed .add_activity (activity_data )['id' ]
404396
405- self ._test_sleep (10 , 0.25 )
406397
407398 agg_feed .follow (user_feed .slug , user_feed .user_id )
408399 user_feed .remove_activity (activity_id )
409400
410- for x in range (40 ):
411- activities = agg_feed .get (limit = 3 )['results' ]
412- activity = self ._get_first_aggregated_activity (activities )
413- activity_id_found = (activity ['id' ] if activity is not None
414- else None )
415-
416- try :
417- self .assertNotEqual (activity_id_found , activity_id )
418- except AssertionError :
419- self ._test_sleep (1 , 0.1 )
420- else :
421- break
401+ activities = agg_feed .get (limit = 3 )['results' ]
402+ activity = self ._get_first_aggregated_activity (activities )
403+ activity_id_found = (activity ['id' ] if activity is not None
404+ else None )
422405
423406 self .assertNotEqual (activity_id_found , activity_id )
424407
@@ -429,7 +412,6 @@ def test_follow_and_delete(self):
429412 # activity_data = {'actor': actor_id, 'verb': 'tweet', 'object': 1}
430413 # activity_id = feed.add_activity(activity_data)['id']
431414 # agg_feed.follow(feed.slug, feed.user_id)
432- # time._test_sleep(10, 0.25)
433415 # activities = agg_feed.get(limit=3)['results']
434416 # activity = self._get_first_aggregated_activity(activities)
435417 # activity_id_found = activity['id'] if activity is not None else None
@@ -441,7 +423,6 @@ def test_flat_follow(self):
441423 activity_id = feed .add_activity (activity_data )['id' ]
442424 self .flat3 .follow (feed .slug , feed .user_id )
443425
444- self ._test_sleep (5 , 0.25 )
445426
446427 activities = self .flat3 .get (limit = 3 )['results' ]
447428 activity = self ._get_first_activity (activities )
@@ -455,7 +436,6 @@ def test_flat_follow_no_copy(self):
455436 feed .add_activity (activity_data )['id' ]
456437 follower .follow (feed .slug , feed .user_id , activity_copy_limit = 0 )
457438
458- self ._test_sleep (5 , 0.25 )
459439
460440 activities = follower .get (limit = 3 )['results' ]
461441 self .assertEqual (activities , [])
@@ -469,7 +449,6 @@ def test_flat_follow_copy_one(self):
469449 feed .add_activity (activity_data )['id' ]
470450 follower .follow (feed .slug , feed .user_id , activity_copy_limit = 1 )
471451
472- self ._test_sleep (5 , 0.25 )
473452
474453 activities = follower .get (limit = 3 )['results' ]
475454 # verify we get the latest activity
@@ -576,7 +555,6 @@ def test_mark_read(self):
576555 activity_data = {'actor' : 3 , 'verb' : 'watch' , 'object' : 2 }
577556 notification_feed .add_activity (activity_data )
578557
579- self ._test_sleep (10 , 0.25 )
580558
581559 activities = notification_feed .get (limit = 3 )['results' ]
582560 for activity in activities :
@@ -592,7 +570,6 @@ def test_get_not_marked_seen(self):
592570 notification_feed .add_activity ({'actor' : 2 , 'verb' : 'add' , 'object' : 2 })
593571 notification_feed .add_activity ({'actor' : 3 , 'verb' : 'watch' , 'object' : 3 })
594572
595- self ._test_sleep (10 , 0.25 )
596573
597574 activities = notification_feed .get (limit = 3 )['results' ]
598575 for activity in activities :
@@ -604,18 +581,15 @@ def test_mark_seen_on_get(self):
604581 for activity in activities :
605582 notification_feed .remove_activity (activity ['id' ])
606583
607- self ._test_sleep (10 , 0.25 )
608584
609585 old_activities = [
610586 notification_feed .add_activity ({'actor' : 1 , 'verb' : 'tweet' , 'object' : 1 }),
611587 notification_feed .add_activity ({'actor' : 2 , 'verb' : 'add' , 'object' : 2 }),
612588 notification_feed .add_activity ({'actor' : 3 , 'verb' : 'watch' , 'object' : 3 }),
613589 ]
614590
615- self ._test_sleep (10 , 2 )
616591 notification_feed .get (mark_seen = [old_activities [0 ]['id' ], old_activities [1 ]['id' ]])
617592
618- self ._test_sleep (10 , 0.25 )
619593 activities = notification_feed .get (limit = 3 )['results' ]
620594
621595 # is the seen state correct
@@ -630,7 +604,6 @@ def test_mark_seen_on_get(self):
630604
631605 # see if the state properly resets after we add another activity
632606 notification_feed .add_activity ({'actor' : 3 , 'verb' : 'watch' , 'object' : 3 }) # ['id']
633- self ._test_sleep (10 , 0.25 )
634607 activities = notification_feed .get (limit = 3 )['results' ]
635608 self .assertFalse (activities [0 ]['is_seen' ])
636609 self .assertEqual (len (activities [0 ]['activities' ]), 2 )
@@ -641,7 +614,6 @@ def test_mark_read_by_id(self):
641614 notification_feed .add_activity ({'actor' : 2 , 'verb' : 'add' , 'object' : 2 }) # ['id']
642615 notification_feed .add_activity ({'actor' : 3 , 'verb' : 'watch' , 'object' : 2 }) # ['id']
643616
644- self ._test_sleep (10 , 0.25 )
645617
646618 activities = notification_feed .get (limit = 3 )['results' ]
647619 ids = []
@@ -699,7 +671,6 @@ def test_uniqueness(self):
699671 response = self .user1 .add_activity (activity_data )
700672 response = self .user1 .add_activity (activity_data )
701673
702- self ._test_sleep (5 , 0.25 )
703674
704675 activities = self .user1 .get (limit = 2 )['results' ]
705676 self .assertDatetimeAlmostEqual (activities [0 ]['time' ], utcnow )
@@ -754,7 +725,6 @@ def test_time_ordering(self):
754725 now = datetime .datetime .utcnow
755726 feed = self .user2
756727 for index , activity_time in enumerate ([None , now , None ]):
757- self ._test_sleep (1 , 0.1 )
758728 if activity_time is not None :
759729 activity_time = activity_time ()
760730 middle = activity_time
@@ -843,15 +813,13 @@ def test_follow_many_acl(self):
843813 }
844814 for feed in targets :
845815 feed .add_activity (activity )
846- self ._test_sleep (1 , 0.1 )
847816 self .assertEqual (len (feed .get (limit = 5 )['results' ]), 1 )
848817
849818 sources_id = [feed .id for feed in sources ]
850819 targets_id = [target .id for target in targets ]
851820 feeds = [{'source' : s , 'target' : t } for s , t in zip (sources_id , targets_id )]
852821
853822 self .c .follow_many (feeds , activity_copy_limit = 0 )
854- self ._test_sleep (5 , 2 )
855823
856824 for feed in sources :
857825 activities = feed .get (limit = 5 )['results' ]
@@ -862,7 +830,6 @@ def test_add_to_many(self):
862830 feeds = [getfeed ('flat' , str (i )).id for i in range (10 , 20 )]
863831 self .c .add_to_many (activity , feeds )
864832
865- self ._test_sleep (3 , 0.25 )
866833
867834 for feed in feeds :
868835 feed = self .c .feed (* feed .split (':' ))
0 commit comments