Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
kvdb
rocksdb
提交
e89e5b25
R
rocksdb
项目概览
kvdb
/
rocksdb
11 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rocksdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e89e5b25
编写于
11月 05, 2015
作者:
I
Islam AbdelRahman
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #818 from yuslepukhin/improve_test_concurrency
Improve concurrency when running tests
上级
ae7940b6
3277d172
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
47 addition
and
26 deletion
+47
-26
build_tools/run_ci_db_test.ps1
build_tools/run_ci_db_test.ps1
+47
-26
未找到文件。
build_tools/run_ci_db_test.ps1
浏览文件 @
e89e5b25
...
...
@@ -8,7 +8,10 @@ Param(
[
string
]
$WorkFolder
=
""
,
# Direct tests to use that folder
[
int
]
$Limit
=
-1
,
# -1 means run all otherwise limit for testing purposes
[
string
]
$Exclude
=
""
,
# Expect a comma separated list, no spaces
[
string
]
$Run
=
"db_test"
# Run db_test|tests
[
string
]
$Run
=
"db_test"
,
# Run db_test|tests
# Number of async tasks that would run concurrently. Recommend a number below 64.
# However, CPU utlization really depends on the storage media. Recommend ram based disk.
[
int
]
$Concurrency
=
62
)
# Folders and commands must be fullpath to run assuming
...
...
@@ -122,10 +125,17 @@ function Normalize-DbTests($HashTable) {
function
Discover-TestBinaries
(
$HashTable
)
{
$Exclusions
=
@(
"db_test*"
,
"db_sanity_test*"
)
$p
=
-join
(
$BinariesFolder
,
"*_test*.exe"
)
if
(
$EnableJE
)
{
$p
=
-join
(
$BinariesFolder
,
"*_test_je.exe"
)
}
else
{
$p
=
-join
(
$BinariesFolder
,
"*_test.exe"
)
}
dir
-Path
$p
-Exclude
$Exclusions
|
ForEach-Object
{
$t
=
(
$_
.
Name
)
-replace
'.exe$'
,
''
if
(
$ExcludeTests
.
Contains
(
$t
))
{
continue
}
$test_log
=
-join
(
$t
,
".log"
)
$HashTable
.
Add
(
$t
,
$test_log
)
}
...
...
@@ -137,6 +147,9 @@ if($Run -ceq "db_test") {
Normalize-DbTests
-HashTable
$TestToLog
}
elseif
(
$Run
-ceq
"tests"
)
{
Discover-TestBinaries
-HashTable
$TestToLog
}
else
{
Write-Warning
"Invalid -Run option value"
exit
2
}
...
...
@@ -159,39 +172,47 @@ $JobToLog = @{}
# Test limiting factor here
$count
=
0
ForEach
(
$k
in
$TestToLog
.
keys
)
{
[
bool
]
$success
=
$true
;
Write-Host
"Starting
$k
"
$log_path
=
-join
(
$LogFolder
,
(
$TestToLog
.
$k
))
# Wait for all to finish and get the results
while
((
$JobToLog
.
Count
-gt
0
)
-or
(
$TestToLog
.
Count
-gt
0
))
{
if
(
$Run
-ceq
"db_test"
)
{
$job
=
Start-Job
-Name
$k
-ScriptBlock
$InvokeTestCase
-ArgumentList
@(
$db_test
,
$k
,
$log_path
)
}
else
{
[
string
]
$Exe
=
-Join
(
$BinariesFolder
,
$k
)
$job
=
Start-Job
-Name
$k
-ScriptBlock
$InvokeTestAsync
-ArgumentList
@(
$exe
,
$log_path
)
}
# Make sure we have maximum concurrent jobs running if anything
# and the $Limit either not set or allows to proceed
while
((
$JobToLog
.
Count
-lt
$Concurrency
)
-and
((
$TestToLog
.
Count
-gt
0
)
-and
((
$Limit
-lt
0
)
-or
(
$count
-lt
$Limit
))))
{
$JobToLog
.
Add
(
$job
,
$log_path
)
# Limiting trial runs
if
((
$Limit
-gt
0
)
-and
(
++
$count
-ge
$Limit
)
)
{
break
}
}
# We only need the first key
foreach
(
$key
in
$TestToLog
.
keys
)
{
$k
=
$key
break
}
[
bool
]
$success
=
$true
;
Write-Host
"Starting
$k
"
$log_path
=
-join
(
$LogFolder
,
(
$TestToLog
.
$k
))
# Wait for all to finish and get the results
while
(
$JobToLog
.
Count
-gt
0
)
{
if
(
$Run
-ceq
"db_test"
)
{
$job
=
Start-Job
-Name
$k
-ScriptBlock
$InvokeTestCase
-ArgumentList
@(
$db_test
,
$k
,
$log_path
)
}
else
{
[
string
]
$Exe
=
-Join
(
$BinariesFolder
,
$k
)
$job
=
Start-Job
-Name
$k
-ScriptBlock
$InvokeTestAsync
-ArgumentList
@(
$exe
,
$log_path
)
}
$jobs
=
@(
)
foreach
(
$k
in
$JobToLog
.
Keys
)
{
$jobs
+=
$k
}
$JobToLog
.
Add
(
$job
,
$log_path
)
$TestToLog
.
Remove
(
$k
)
<#
if(!$success) {
break
++
$count
}
#>
if
(
$JobToLog
.
Count
-lt
1
)
{
break
}
$jobs
=
@()
foreach
(
$k
in
$JobToLog
.
Keys
)
{
$jobs
+=
$k
}
$completed
=
Wait-Job
-Job
$jobs
-Any
$log
=
$JobToLog
[
$completed
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录