Skip to content

Commit

Permalink
Fixed additional flacky test
Browse files Browse the repository at this point in the history
  • Loading branch information
vladvildanov committed Dec 26, 2024
1 parent 7f039d9 commit ccb65d9
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions tests/test_auth/test_token_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,13 @@ def test_token_renewal_with_skip_initial(self):
mock_provider.request_token.side_effect = [
SimpleToken(
"value",
(datetime.now(timezone.utc).timestamp() * 1000) + 100,
(datetime.now(timezone.utc).timestamp() * 1000),
{"oid": "test"},
),
SimpleToken(
"value",
(datetime.now(timezone.utc).timestamp() * 1000) + 120,
(datetime.now(timezone.utc).timestamp() * 1000) + 50,
(datetime.now(timezone.utc).timestamp() * 1000),
{"oid": "test"},
),
SimpleToken(
"value",
(datetime.now(timezone.utc).timestamp() * 1000) + 140,
(datetime.now(timezone.utc).timestamp() * 1000) + 150,
(datetime.now(timezone.utc).timestamp() * 1000),
{"oid": "test"},
),
Expand All @@ -207,9 +201,9 @@ def on_next(token):
mgr.start(mock_listener, skip_initial=True)
# Should be less than a 0.1, or it will be flacky due to
# additional token renewal.
sleep(0.2)
sleep(0.1)

assert len(tokens) == 2
assert len(tokens) == 1

@pytest.mark.asyncio
async def test_async_token_renewal_with_skip_initial(self):
Expand Down

0 comments on commit ccb65d9

Please sign in to comment.