Skip to content

Commit 70cc510

Browse files
committed
Fixing randomly failing test
1 parent 00f5be4 commit 70cc510

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_asyncio/test_hash.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import math
23
from datetime import datetime, timedelta
34

45
from tests.conftest import skip_if_server_version_lt
@@ -175,9 +176,9 @@ async def test_hexpireat_multiple_fields(r):
175176
"test:hash",
176177
mapping={"field1": "value1", "field2": "value2", "field3": "value3"},
177178
)
178-
exp_time = int((datetime.now() + timedelta(seconds=1)).timestamp())
179+
exp_time = math.ceil((datetime.now() + timedelta(seconds=1)).timestamp())
179180
assert await r.hexpireat("test:hash", exp_time, "field1", "field2") == [1, 1]
180-
await asyncio.sleep(1.5)
181+
await asyncio.sleep(2.1)
181182
assert await r.hexists("test:hash", "field1") is False
182183
assert await r.hexists("test:hash", "field2") is False
183184
assert await r.hexists("test:hash", "field3") is True

0 commit comments

Comments
 (0)