Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Turbo码先生
redis
提交
eae26153
R
redis
项目概览
Turbo码先生
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
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,体验更适合开发者的 AI 搜索 >>
提交
eae26153
编写于
4月 17, 2020
作者:
A
antirez
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'unstable' of github.com:/antirez/redis into unstable
上级
37b135a4
a71a6b5a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
50 addition
and
2 deletion
+50
-2
.github/workflows/ci.yml
.github/workflows/ci.yml
+2
-2
redis.conf
redis.conf
+8
-0
tests/test_helper.tcl
tests/test_helper.tcl
+38
-0
tests/unit/memefficiency.tcl
tests/unit/memefficiency.tcl
+2
-0
未找到文件。
.github/workflows/ci.yml
浏览文件 @
eae26153
...
...
@@ -12,9 +12,9 @@ jobs:
-
name
:
test
run
:
|
sudo apt-get install tcl8.5
./runtest --
clients 2 --
verbose
./runtest --verbose
-
name
:
module api test
run
:
./runtest-moduleapi --
clients 2 --
verbose
run
:
./runtest-moduleapi --verbose
build-ubuntu-old
:
runs-on
:
ubuntu-16.04
...
...
redis.conf
浏览文件 @
eae26153
...
...
@@ -737,6 +737,14 @@ replica-priority 100
# For more information about ACL configuration please refer to
# the Redis web site at https://redis.io/topics/acl
# ACL LOG
#
# The ACL Log tracks failed commands and authentication events associated
# with ACLs. The ACL Log is useful to troubleshoot failed commands blocked
# by ACLs. The ACL Log is stored in memory. You can reclaim memory with
# ACL LOG RESET. Define the maximum entry length of the ACL Log below.
acllog
-
max
-
len
128
# Using an external ACL file
#
# Instead of configuring users here in this file, it is possible to use
...
...
tests/test_helper.tcl
浏览文件 @
eae26153
...
...
@@ -82,6 +82,7 @@ set ::skiptests {}
set ::allowtags
{}
set ::only_tests
{}
set ::single_tests
{}
set ::run_solo_tests
{}
set ::skip_till
""
set ::external 0
;
# If
"1"
this means, we are running against external instance
set ::file
""
;
# If set, runs only the tests in this comma separated list
...
...
@@ -112,6 +113,11 @@ proc execute_tests name {
send_data_packet $::test_server_fd done
"
$name
"
}
proc execute_code
{
name code
}
{
eval $code
send_data_packet $::test_server_fd done
"
$name
"
}
# Setup a list to hold a stack of server configs. When calls to start_server
# are nested, use
"srv 0 pid"
to get the pid of the inner server. To access
# outer servers, use
"srv -1 pid"
etcetera.
...
...
@@ -188,6 +194,18 @@ proc s {args} {
status
[
srv $level
"client"
]
[
lindex $args 0
]
}
# Test wrapped into run_solo are sent back from the client to the
# test server, so that the test server will send them again to
# clients once the clients are idle.
proc run_solo
{
name code
}
{
if
{
$::numclients
== 1 || $::loop || $::external
}
{
# run_solo is not supported in these scenarios, just run the code.
eval $code
return
}
send_data_packet $::test_server_fd run_solo
[
list $name $code
]
}
proc cleanup
{}
{
if
{
$::dont
_clean
}
{
return
...
...
@@ -337,6 +355,8 @@ proc read_from_test_client fd {
}
elseif
{
$status
eq
{
server-killed
}}
{
set ::active_servers
[
lsearch -all -inline -not -exact $::active_servers $data
]
set ::active_clients_task
(
$fd
)
"(KILLED SERVER) pid:
$data
"
}
elseif
{
$status
eq
{
run_solo
}}
{
lappend ::run_solo_tests $data
}
else
{
if
{
!$::quiet
}
{
puts
"
\[
$status
\]
:
$data
"
...
...
@@ -369,6 +389,13 @@ proc force_kill_all_servers {} {
}
}
proc lpop
{
listVar
{
count 1
}}
{
upvar 1 $listVar l
set ele
[
lindex $l 0
]
set l
[
lrange $l 1 end
]
set ele
}
# A new client is idle. Remove it from the list of active clients and
# if there are still test units to run, launch them.
proc signal_idle_client fd
{
...
...
@@ -389,6 +416,14 @@ proc signal_idle_client fd {
if
{
$::loop
&& $::next_test ==
[
llength $::all_tests
]}
{
set ::next_test 0
}
}
elseif
{[
llength $::run_solo_tests
]
!= 0 &&
[
llength $::active_clients
]
== 0
}
{
if
{
!$::quiet
}
{
puts
[
colorstr bold-white
"Testing solo test"
]
set ::active_clients_task
(
$fd
)
"ASSIGNED:
$fd
solo test"
}
set ::clients_start_time
(
$fd
)
[
clock seconds
]
send_data_packet $fd run_code
[
lpop ::run_solo_tests
]
lappend ::active_clients $fd
}
else
{
lappend ::idle_clients $fd
set ::active_clients_task
(
$fd
)
"SLEEPING, no more units to assign"
...
...
@@ -433,6 +468,9 @@ proc test_client_main server_port {
foreach
{
cmd data
}
$payload break
if
{
$cmd
eq
{
run
}}
{
execute_tests $data
}
elseif
{
$cmd
eq
{
run_code
}}
{
foreach
{
name code
}
$data break
execute_code $name $code
}
else
{
error
"Unknown test client command:
$cmd
"
}
...
...
tests/unit/memefficiency.tcl
浏览文件 @
eae26153
...
...
@@ -36,6 +36,7 @@ start_server {tags {"memefficiency"}} {
}
}
run_solo
{
defrag
}
{
start_server
{
tags
{
"defrag"
}}
{
if
{[
string match
{
*jemalloc*
}
[
s mem_allocator
]]}
{
test
"Active defrag"
{
...
...
@@ -328,3 +329,4 @@ start_server {tags {"defrag"}} {
}
{
1
}
}
}
}
;
# run_solo
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录