Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Incubator Pegasus
提交
dea2bd9b
Incubator Pegasus
项目概览
apache
/
Incubator Pegasus
通知
9
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Incubator Pegasus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
dea2bd9b
编写于
8月 27, 2019
作者:
小地鼠家的小松鼠
提交者:
QinZuoyan
8月 27, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: unit test failed and update rdsn (#384)
上级
695ad274
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
66 addition
and
30 deletion
+66
-30
.travis.yml
.travis.yml
+3
-3
rdsn
rdsn
+1
-1
run.sh
run.sh
+6
-1
scripts/start_zk.sh
scripts/start_zk.sh
+2
-2
scripts/travis.sh
scripts/travis.sh
+1
-1
src/server/config.min.ini
src/server/config.min.ini
+3
-2
src/server/test/pegasus_write_service_test.cpp
src/server/test/pegasus_write_service_test.cpp
+4
-0
src/shell/CMakeLists.txt
src/shell/CMakeLists.txt
+1
-1
src/test/function_test/CMakeLists.txt
src/test/function_test/CMakeLists.txt
+1
-1
src/test/function_test/run.sh
src/test/function_test/run.sh
+24
-5
src/test/function_test/test_recovery.cpp
src/test/function_test/test_recovery.cpp
+17
-10
src/test/function_test/test_restore.cpp
src/test/function_test/test_restore.cpp
+3
-3
未找到文件。
.travis.yml
浏览文件 @
dea2bd9b
...
...
@@ -20,7 +20,7 @@ cache:
-
apt
before_install
:
-
wget https://
media.githubusercontent.com/media/XiaoMi/pegasus-common/master
/build-depends.tar.gz
-
wget https://
github.com/XiaoMi/pegasus-common/releases/download/deps
/build-depends.tar.gz
-
tar xfz build-depends.tar.gz
-
rm -f build-depends.tar.gz
-
cd packages
...
...
@@ -35,8 +35,8 @@ install:
before_script
:
-
cd rdsn/thirdparty
-
wget https://
media.githubusercontent.com/media/XiaoMi/pegasus-common/master
/pegasus-thirdparty-prebuild.tar.gz
-
tar xf
z
pegasus-thirdparty-prebuild.tar.gz
-
wget https://
github.com/XiaoMi/pegasus-common/releases/download/deps
/pegasus-thirdparty-prebuild.tar.gz
-
tar xf pegasus-thirdparty-prebuild.tar.gz
-
rm -f pegasus-thirdparty-prebuild.tar.gz
-
cd ../..
-
ulimit -c unlimited -S
...
...
rdsn
@
c3c13269
比较
fb3ed3bc
...
c3c13269
Subproject commit
fb3ed3bc5866bb3a7435e6f6fff31ff0dc5fa565
Subproject commit
c3c13269083506ec28a7d3b931261f51b6c5f741
run.sh
浏览文件 @
dea2bd9b
...
...
@@ -308,11 +308,13 @@ function usage_test()
echo
" -h|--help print the help info"
echo
" -m|--modules set the test modules: pegasus_unit_test pegasus_function_test"
echo
" -k|--keep_onebox whether keep the onebox after the test[default false]"
echo
" --on_travis run tests on travis without some time-cosuming function tests"
}
function
run_test
()
{
local
test_modules
=
""
local
clear_flags
=
"1"
local
on_traivs
=
""
while
[[
$#
>
0
]]
;
do
key
=
"
$1
"
case
$key
in
...
...
@@ -327,6 +329,9 @@ function run_test()
-k
|
--keep_onebox
)
clear_flags
=
""
;;
--on_travis
)
on_travis
=
"--on_travis"
;;
*
)
echo
"Error: unknow option
\"
$key
\"
"
echo
...
...
@@ -349,7 +354,7 @@ function run_test()
for
module
in
`
echo
$test_modules
`
;
do
pushd
$ROOT
/src/builder/bin/
$module
REPORT_DIR
=
$REPORT_DIR
./run.sh
REPORT_DIR
=
$REPORT_DIR
./run.sh
$on_travis
if
[
$?
!=
0
]
;
then
echo
"run test
\"
$module
\"
in
`
pwd
`
failed"
exit
1
...
...
scripts/start_zk.sh
浏览文件 @
dea2bd9b
...
...
@@ -30,7 +30,7 @@ if [ ! -f zookeeper-3.4.6.tar.gz ]; then
download_url
=
"http://git.n.xiaomi.com/pegasus/packages/raw/master/zookeeper-3.4.6.tar.gz"
wget
-T
5
-t
1
$download_url
if
[
$?
-ne
0
]
;
then
download_url
=
"https://github.com/
xiaomi/pegasus-common/raw/master
/zookeeper-3.4.6.tar.gz"
download_url
=
"https://github.com/
XiaoMi/pegasus-common/releases/download/deps
/zookeeper-3.4.6.tar.gz"
wget
-T
5
-t
1
$download_url
if
[
$?
-ne
0
]
;
then
echo
"ERROR: download zookeeper failed"
...
...
@@ -41,7 +41,7 @@ fi
if
[
!
-d
zookeeper-3.4.6
]
;
then
echo
"Decompressing zookeeper..."
tar
xf
z
zookeeper-3.4.6.tar.gz
tar
xf zookeeper-3.4.6.tar.gz
if
[
$?
-ne
0
]
;
then
echo
"ERROR: decompress zookeeper failed"
exit
1
...
...
scripts/travis.sh
浏览文件 @
dea2bd9b
...
...
@@ -16,7 +16,7 @@ if [ "$modified" ]; then
exit
1
fi
"
${
root
}
"
/run.sh build
-c
--skip_thirdparty
--disable_gperf
&&
./run.sh
test
"
${
root
}
"
/run.sh build
-c
--skip_thirdparty
--disable_gperf
&&
./run.sh
test
--on_travis
if
[
$?
]
;
then
echo
"travis failed with exit code
$?
"
...
...
src/server/config.min.ini
浏览文件 @
dea2bd9b
...
...
@@ -6,7 +6,7 @@
type
=
meta
name
=
meta
ports
=
@META_PORT@
pools
=
THREAD_POOL_DEFAULT,THREAD_POOL_META_SERVER,THREAD_POOL_META_STATE,THREAD_POOL_FD,THREAD_POOL_DLOCK
pools
=
THREAD_POOL_DEFAULT,THREAD_POOL_META_SERVER,THREAD_POOL_META_STATE,THREAD_POOL_FD,THREAD_POOL_DLOCK
,THREAD_POOL_LOCAL_SERVICE
[apps.replica]
type
=
replica
...
...
@@ -34,7 +34,7 @@
stderr_start_level
=
LOG_LEVEL_ERROR
[threadpool..default]
worker_count
=
1
worker_count
=
4
worker_priority
=
THREAD_xPRIORITY_NORMAL
partitioned
=
false
...
...
@@ -87,6 +87,7 @@
server_load_balancer_type
=
greedy_load_balancer
min_live_node_count_for_unfreeze
=
1
cold_backup_disabled
=
false
recover_from_replica_server
=
false
[replication]
allow_non_idempotent_write
=
true
...
...
src/server/test/pegasus_write_service_test.cpp
浏览文件 @
dea2bd9b
...
...
@@ -80,6 +80,8 @@ public:
void
test_multi_remove
()
{
dsn
::
fail
::
setup
();
dsn
::
apps
::
multi_remove_request
request
;
dsn
::
apps
::
multi_remove_response
response
;
...
...
@@ -123,6 +125,8 @@ public:
ASSERT_EQ
(
err
,
0
);
verify_response
(
response
,
0
,
decree
);
}
dsn
::
fail
::
teardown
();
}
void
test_batched_writes
()
...
...
src/shell/CMakeLists.txt
浏览文件 @
dea2bd9b
...
...
@@ -38,7 +38,7 @@ set(MY_PROJ_LIBS
set
(
MY_BINPLACES
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/config.ini"
)
set
(
MY_BOOST_LIBS Boost::system Boost::filesystem
)
set
(
MY_BOOST_LIBS Boost::system Boost::filesystem
Boost::regex
)
SET
(
CMAKE_INSTALL_RPATH
"."
)
SET
(
CMAKE_BUILD_WITH_INSTALL_RPATH TRUE
)
...
...
src/test/function_test/CMakeLists.txt
浏览文件 @
dea2bd9b
...
...
@@ -25,7 +25,7 @@ else()
set
(
MY_PROJ_LIBS
${
MY_PROJ_LIBS
}
gtest
)
endif
()
set
(
MY_BOOST_LIBS Boost::system Boost::filesystem
)
set
(
MY_BOOST_LIBS Boost::system Boost::filesystem
Boost::regex
)
set
(
MY_BINPLACES
"config.ini"
"run.sh"
)
...
...
src/test/function_test/run.sh
浏览文件 @
dea2bd9b
#!/bin/sh
#!/bin/
ba
sh
exit_if_fail
()
{
if
[
$1
!=
0
]
;
then
...
...
@@ -11,6 +11,23 @@ if [ -z $REPORT_DIR ]; then
REPORT_DIR
=
"./"
fi
# If run function tests on traivs, we exclude some time-consuming tests
# incluing restore test, recovery test
on_travis
=
"NO"
while
[
$#
-gt
0
]
;
do
key
=
"
$1
"
case
$key
in
--on_travis
)
on_travis
=
"YES"
;;
*
)
echo
"Error: unknow option
\"
$key
\"
"
exit
1
;;
esac
shift
done
test_case
=
pegasus_function_test
config_file
=
config.ini
table_name
=
temp
...
...
@@ -31,7 +48,9 @@ GTEST_OUTPUT="xml:$REPORT_DIR/slog_log.xml" GTEST_FILTER="lost_log.*" ./$test_ca
exit_if_fail
$?
"run test slog_lost failed:
$test_case
$config_file
$table_name
"
GTEST_OUTPUT
=
"xml:
$REPORT_DIR
/recall.xml"
GTEST_FILTER
=
"drop_and_recall.*"
./
$test_case
$config_file
$table_name
exit_if_fail
$?
"run test recall failed:
$test_case
$config_file
$table_name
"
GTEST_OUTPUT
=
"xml:
$REPORT_DIR
/restore.xml"
GTEST_FILTER
=
"restore_test.*"
./
$test_case
$config_file
$table_name
exit_if_fail
$?
"run test restore_test failed:
$test_case
$config_file
$table_name
"
GTEST_OUTPUT
=
"xml:
$REPORT_DIR
/recovery.xml"
GTEST_FILTER
=
"recovery_test.*"
./
$test_case
$config_file
$table_name
exit_if_fail
$?
"run test recovery failed:
$test_case
$config_file
$table_name
"
if
[
$on_travis
==
"NO"
]
;
then
GTEST_OUTPUT
=
"xml:
$REPORT_DIR
/restore.xml"
GTEST_FILTER
=
"restore_test.*"
./
$test_case
$config_file
$table_name
exit_if_fail
$?
"run test restore_test failed:
$test_case
$config_file
$table_name
"
GTEST_OUTPUT
=
"xml:
$REPORT_DIR
/recovery.xml"
GTEST_FILTER
=
"recovery_test.*"
./
$test_case
$config_file
$table_name
exit_if_fail
$?
"run test recovery failed:
$test_case
$config_file
$table_name
"
fi
src/test/function_test/test_recovery.cpp
浏览文件 @
dea2bd9b
...
...
@@ -28,18 +28,24 @@ class recovery_test : public testing::Test
protected:
virtual
void
SetUp
()
{
// THREAD_POOL_META_SERVER worker count should be greater than 1
// This function test update 'distributed_lock_service_type' to
// 'distributed_lock_service_simple', which executes in threadpool THREAD_POOL_META_SERVER
// As a result, failure detection lock executes in this pool
// if worker count = 1, it will lead to ERR_TIMEOUT when execute 'ddl_client->do_recovery'
// 1. restart onebox, modify the config
chdir
(
global_env
::
instance
().
_pegasus_root
.
c_str
());
system
(
"./run.sh clear_onebox"
);
system
(
"cp src/server/config
-server
.ini config-server-test-recovery.ini"
);
system
(
"sed -i
\"
/^meta_state_service_type/c meta_state_service_type = "
system
(
"cp src/server/config
.min
.ini config-server-test-recovery.ini"
);
system
(
"sed -i
\"
/^
\\
s*
meta_state_service_type/c meta_state_service_type = "
"meta_state_service_simple
\"
config-server-test-recovery.ini"
);
system
(
"sed -i
\"
/^distributed_lock_service_type/c distributed_lock_service_type = "
system
(
"sed -i
\"
/^
\\
s*
distributed_lock_service_type/c distributed_lock_service_type = "
"distributed_lock_service_simple
\"
config-server-test-recovery.ini"
);
system
(
"sed -i
\"
/^server_list/c server_list = @LOCAL_IP@:34601
\"
"
system
(
"sed -i
\"
/^
\\
s*
server_list/c server_list = @LOCAL_IP@:34601
\"
"
"config-server-test-recovery.ini"
);
system
(
"sed -i
\"
/^perf_counter_enable_logging/c perf_counter_enable_logging = false
\"
"
system
(
"sed -i
\"
/^
\\
s*
perf_counter_enable_logging/c perf_counter_enable_logging = false
\"
"
"config-server-test-recovery.ini"
);
system
(
"./run.sh start_onebox -m 1 -r 3 --config_path config-server-test-recovery.ini"
);
...
...
@@ -158,11 +164,12 @@ public:
void
config_meta_to_do_cold_recovery
()
{
char
command
[
512
];
snprintf
(
command
,
512
,
"cd %s && sed -i
\"
/^recover_from_replica_server/c recover_from_replica_server = "
"true
\"
onebox/meta1/config.ini"
,
global_env
::
instance
().
_pegasus_root
.
c_str
());
snprintf
(
command
,
512
,
"cd %s && sed -i
\"
/^
\\
s*recover_from_replica_server/c recover_from_replica_server = "
"true
\"
onebox/meta1/config.ini"
,
global_env
::
instance
().
_pegasus_root
.
c_str
());
system
(
command
);
}
...
...
src/test/function_test/test_restore.cpp
浏览文件 @
dea2bd9b
...
...
@@ -27,10 +27,10 @@ public:
// modify the config to enable backup, and restart onebox
system
(
"./run.sh clear_onebox"
);
system
(
"cp src/server/config
-server
.ini config-server-test-restore.ini"
);
system
(
"sed -i
\"
/^cold_backup_disabled/c cold_backup_disabled = false
\"
"
system
(
"cp src/server/config
.min
.ini config-server-test-restore.ini"
);
system
(
"sed -i
\"
/^
\\
s*
cold_backup_disabled/c cold_backup_disabled = false
\"
"
"config-server-test-restore.ini"
);
std
::
string
cmd
=
"sed -i
\"
/^cold_backup_root/c cold_backup_root = "
+
cluster_name
;
std
::
string
cmd
=
"sed -i
\"
/^
\\
s*
cold_backup_root/c cold_backup_root = "
+
cluster_name
;
cmd
=
cmd
+
std
::
string
(
"
\"
config-server-test-restore.ini"
);
system
(
cmd
.
c_str
());
system
(
"./run.sh start_onebox --config_path config-server-test-restore.ini"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录