diff --git a/data/users/test/test_teamsync.py b/data/users/test/test_teamsync.py index 22d999123..2c6bbb223 100644 --- a/data/users/test/test_teamsync.py +++ b/data/users/test/test_teamsync.py @@ -1,4 +1,5 @@ from datetime import timedelta +import time import pytest @@ -210,6 +211,8 @@ def test_sync_teams_to_groups(app): # Call to sync all teams. fake_auth = FakeUsers([]) + + time.sleep(1) sync_teams_to_groups(fake_auth, timedelta(seconds=1)) # Ensure the team was synced. @@ -218,13 +221,15 @@ def test_sync_teams_to_groups(app): assert updated_sync_info.transaction_id != sync_team_info.transaction_id # Set the stale threshold to a high amount and ensure the team is not resynced. + time.sleep(1) sync_teams_to_groups(fake_auth, timedelta(seconds=120)) third_sync_info = model.team.get_team_sync_information('buynlarge', 'synced') assert third_sync_info.last_updated == updated_sync_info.last_updated assert third_sync_info.transaction_id == updated_sync_info.transaction_id - # Set the stale threshold to -10 seconds, and ensure the team is resynced. + # Set the stale threshold to -120 seconds, and ensure the team is resynced. + time.sleep(1) sync_teams_to_groups(fake_auth, timedelta(seconds=-120)) fourth_sync_info = model.team.get_team_sync_information('buynlarge', 'synced')