Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xindoo
redis
提交
a5cc063c
R
redis
项目概览
xindoo
/
redis
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a5cc063c
编写于
1月 10, 2013
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Test: added regression for issue #872.
上级
baee5650
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
7 deletion
+27
-7
tests/unit/scripting.tcl
tests/unit/scripting.tcl
+27
-7
未找到文件。
tests/unit/scripting.tcl
浏览文件 @
a5cc063c
...
...
@@ -297,6 +297,12 @@ start_server {tags {"scripting"}} {
assert_equal
[
r ping
]
"PONG"
}
test
{
Timedout script link is still usable after Lua returns
}
{
r config set lua-time-limit 10
r eval
{
for i=1,100000 do redis.call
(
'ping'
)
end return 'ok'
}
0
r ping
}
{
PONG
}
test
{
Timedout scripts that modified data can't be killed by SCRIPT KILL
}
{
set rd
[
redis_deferring_client
]
r config set lua-time-limit 10
...
...
@@ -310,6 +316,8 @@ start_server {tags {"scripting"}} {
assert_match
{
BUSY*
}
$e
}
# Note: keep this test at the end of this server stanza because it
# kills the server.
test
{
SHUTDOWN NOSAVE can kill a timedout script anyway
}
{
# The server sould be still unresponding to normal commands.
catch
{
r ping
}
e
...
...
@@ -323,9 +331,16 @@ start_server {tags {"scripting"}} {
start_server
{
tags
{
"scripting repl"
}}
{
start_server
{}
{
test
{
Before the slave connects we issue an EVAL command
}
{
test
{
Before the slave connects we issue two EVAL commands
}
{
# One with an error, but still executing a command.
# SHA is: 6e8bd6bdccbe78899e3cc06b31b6dbf4324c2e56
catch
{
r eval
{
redis.call
(
'incr','x'
);
redis.call
(
'nonexisting'
)}
0
}
# One command is correct:
# SHA is: ae3477e27be955de7e1bc9adfdca626b478d3cb2
r eval
{
return redis.call
(
'incr','x'
)}
0
}
{
1
}
}
{
2
}
test
{
Connect a slave to the main instance
}
{
r -1 slaveof
[
srv 0 host
]
[
srv 0 port
]
...
...
@@ -337,15 +352,20 @@ start_server {tags {"scripting repl"}} {
}
}
test
{
Now use EVALSHA against the master
}
{
test
{
Now use EVALSHA against the master, with both SHAs
}
{
# The server should replicate successful and unsuccessful
# commands as EVAL instead of EVALSHA.
catch
{
r evalsha 6e8bd6bdccbe78899e3cc06b31b6dbf4324c2e56 0
}
r evalsha ae3477e27be955de7e1bc9adfdca626b478d3cb2 0
}
{
2
}
}
{
4
}
test
{
If EVALSHA was replicated as EVAL
the slave should be ok
}
{
test
{
If EVALSHA was replicated as EVAL
, 'x' should be '4'
}
{
wait_for_condition 50 100
{
[
r -1 get x
]
eq
{
2
}
[
r -1 get x
]
eq
{
4
}
}
else
{
fail
"Expected
2
in x, but value is '
[
r -1 get x
]
'"
fail
"Expected
4
in x, but value is '
[
r -1 get x
]
'"
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录