Skip to content

Commit 0c90a7e

Browse files
committed
Fixing MSETEX tests - time set with pxat might be approximated to 1 sec higher than it was set as test expectation
1 parent 204f1c0 commit 0c90a7e

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

tests/test_asyncio/test_commands.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ async def test_msetex_expiration_pxat_and_nx_with_cluster_client(self, r):
13211321
for ttl in old_ttls:
13221322
assert 10 < ttl <= 30
13231323
for ttl in new_ttls:
1324-
assert ttl <= 10
1324+
assert ttl <= 11
13251325
assert await r.mget(*mapping.keys(), "new:{test:1}", "new_2:{test:1}") == [
13261326
b"1",
13271327
b"2",
@@ -1370,8 +1370,8 @@ async def test_msetex_expiration_exat_and_xx_with_cluster_client(self, r):
13701370
== 1
13711371
)
13721372
ttls = await asyncio.gather(*[r.ttl(key) for key in mapping.keys()])
1373-
assert ttls[0] <= 10
1374-
assert ttls[1] <= 10
1373+
assert ttls[0] <= 11
1374+
assert ttls[1] <= 11
13751375
assert 10 < ttls[2] <= 30
13761376
assert await r.mget(
13771377
"1:{test:1}", "2:{test:1}", "3:{test:1}", "new:{test:1}"
@@ -1483,7 +1483,7 @@ async def test_msetex_expiration_pxat_and_nx(self, r):
14831483
for ttl in old_ttls:
14841484
assert 10 < ttl <= 30
14851485
for ttl in new_ttls:
1486-
assert ttl <= 10
1486+
assert ttl <= 11
14871487
assert await r.mget(*mapping.keys(), "new", "new_2") == [
14881488
b"1",
14891489
b"2",
@@ -1527,8 +1527,8 @@ async def test_msetex_expiration_exat_and_xx(self, r):
15271527
== 1
15281528
)
15291529
ttls = await asyncio.gather(*[r.ttl(key) for key in mapping.keys()])
1530-
assert ttls[0] <= 10
1531-
assert ttls[1] <= 10
1530+
assert ttls[0] <= 11
1531+
assert ttls[1] <= 11
15321532
assert 10 < ttls[2] <= 30
15331533
assert await r.mget("1", "2", "3", "new") == [
15341534
b"new_value",

tests/test_commands.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,6 +1896,7 @@ def test_msetex_expiration_pxat_and_nx_with_cluster_client(self, r):
18961896
)
18971897
== 0
18981898
)
1899+
18991900
ttls = [r.ttl(key) for key in mapping.keys()]
19001901
for ttl in ttls:
19011902
assert 10 < ttl <= 30
@@ -1915,7 +1916,7 @@ def test_msetex_expiration_pxat_and_nx_with_cluster_client(self, r):
19151916
for ttl in old_ttls:
19161917
assert 10 < ttl <= 30
19171918
for ttl in new_ttls:
1918-
assert ttl <= 10
1919+
assert ttl <= 11
19191920
assert r.mget(*mapping.keys(), "new:{test:1}", "new_2:{test:1}") == [
19201921
b"1",
19211922
b"2",
@@ -1959,8 +1960,8 @@ def test_msetex_expiration_exat_and_xx_with_cluster_client(self, r):
19591960
== 1
19601961
)
19611962
ttls = [r.ttl(key) for key in mapping.keys()]
1962-
assert ttls[0] <= 10
1963-
assert ttls[1] <= 10
1963+
assert ttls[0] <= 11
1964+
assert ttls[1] <= 11
19641965
assert 10 < ttls[2] <= 30
19651966
assert r.mget("1:{test:1}", "2:{test:1}", "3:{test:1}", "new:{test:1}") == [
19661967
b"new_value",
@@ -2070,7 +2071,7 @@ def test_msetex_expiration_pxat_and_nx(self, r):
20702071
for ttl in old_ttls:
20712072
assert 10 < ttl <= 30
20722073
for ttl in new_ttls:
2073-
assert ttl <= 10
2074+
assert ttl <= 11
20742075
assert r.mget(*mapping.keys(), "new", "new_2") == [
20752076
b"1",
20762077
b"2",
@@ -2114,8 +2115,8 @@ def test_msetex_expiration_exat_and_xx(self, r):
21142115
== 1
21152116
)
21162117
ttls = [r.ttl(key) for key in mapping.keys()]
2117-
assert ttls[0] <= 10
2118-
assert ttls[1] <= 10
2118+
assert ttls[0] <= 11
2119+
assert ttls[1] <= 11
21192120
assert 10 < ttls[2] <= 30
21202121
assert r.mget("1", "2", "3", "new") == [
21212122
b"new_value",

0 commit comments

Comments
 (0)