Unverified Commit 9b20d598 authored by Binbin's avatar Binbin Committed by GitHub
Browse files

Fix flaky PTTL time to live in milliseconds test on slow machines (#11651)

This test failed in FreeBSD:
```
*** [err]: PTTL returns time to live in milliseconds in tests/unit/expire.tcl
Expected 836 > 900 && 836 <= 1000 (context: type eval line 5 cmd {assert {$ttl > 900 && $ttl <= 1000}} proc ::test)
```

On some slow machines, sometimes the test take close to 200ms
to finish. We only set aside 100ms, so that caused the failure.
Since the failure was around 800, change the condition to be >500.
parent 9c7c6924
...@@ -151,7 +151,7 @@ start_server {tags {"expire"}} { ...@@ -151,7 +151,7 @@ start_server {tags {"expire"}} {
r del x r del x
r setex x 1 somevalue r setex x 1 somevalue
set ttl [r pttl x] set ttl [r pttl x]
assert {$ttl > 900 && $ttl <= 1000} assert {$ttl > 500 && $ttl <= 1000}
} }
test {TTL / PTTL / EXPIRETIME / PEXPIRETIME return -1 if key has no expire} { test {TTL / PTTL / EXPIRETIME / PEXPIRETIME return -1 if key has no expire} {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment