summaryrefslogtreecommitdiff
path: root/tests/unit/expire.tcl
diff options
context:
space:
mode:
authorxuzhou <xuzhou1@jd.com>2017-06-16 17:51:38 +0800
committerxuzhou <xuzhou1@jd.com>2017-06-16 17:51:38 +0800
commit530fcf868786950fbd07f294dd73f9f9bd631cb6 (patch)
tree2c7427ffe3a05382d90265aeac2c47e7cc021378 /tests/unit/expire.tcl
parent53cb27b1d718a12e9ff89212ca9b68db12031dde (diff)
downloadredis-530fcf868786950fbd07f294dd73f9f9bd631cb6.tar.gz
Fix set with ex/px option when propagated to aof
Diffstat (limited to 'tests/unit/expire.tcl')
-rw-r--r--tests/unit/expire.tcl15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unit/expire.tcl b/tests/unit/expire.tcl
index 0a50dd31b..eddc7c303 100644
--- a/tests/unit/expire.tcl
+++ b/tests/unit/expire.tcl
@@ -204,4 +204,19 @@ start_server {tags {"expire"}} {
catch {r expire foo ""} e
set e
} {*not an integer*}
+
+ test {SET - use EX/PX option, TTL should not be reseted after loadaof} {
+ r config set appendonly yes
+ r set foo bar EX 100
+ after 2000
+ r debug loadaof
+ set ttl [r ttl foo]
+ assert {$ttl <= 98 && $ttl > 90}
+
+ r set foo bar PX 100000
+ after 2000
+ r debug loadaof
+ set ttl [r ttl foo]
+ assert {$ttl <= 98 && $ttl > 90}
+ }
}