Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
8227de69
A
avocado
项目概览
openeuler
/
avocado
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
avocado
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
8227de69
编写于
6月 24, 2019
作者:
C
Cleber Rosa
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'clebergnu/runner_timeout_configurable'
Signed-off-by:
N
Cleber Rosa
<
crosa@redhat.com
>
上级
d98f8c26
33ebddcb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
46 addition
and
16 deletion
+46
-16
avocado/core/defaults.py
avocado/core/defaults.py
+12
-0
avocado/core/runner.py
avocado/core/runner.py
+23
-16
avocado/etc/avocado/avocado.conf
avocado/etc/avocado/avocado.conf
+11
-0
未找到文件。
avocado/core/defaults.py
浏览文件 @
8227de69
...
...
@@ -18,3 +18,15 @@ The Avocado core defaults
#: The encoding used by default on all data input
ENCODING
=
'utf-8'
#: The amount of time to give to the test process after it it has been
#: interrupted (such as with CTRL+C)
TIMEOUT_AFTER_INTERRUPTED
=
60
#: The amount of to wait for a test status after the process
#: has been noticed to be dead
TIMEOUT_PROCESS_DIED
=
10
#: The amount of time to wait after a test has reported status
#: but the test process has not finished
TIMEOUT_PROCESS_ALIVE
=
60
avocado/core/runner.py
浏览文件 @
8227de69
...
...
@@ -23,14 +23,16 @@ import signal
import
sys
import
time
from
.
import
test
from
.
import
tree
from
.
import
defaults
from
.
import
exceptions
from
.
import
output
from
.
import
status
from
.
import
test
from
.
import
tree
from
.
import
varianter
from
.loader
import
loader
from
.status
import
mapping
from
.settings
import
settings
from
..utils
import
wait
from
..utils
import
runtime
from
..utils
import
process
...
...
@@ -39,13 +41,6 @@ from ..utils import stacktrace
from
.output
import
LOG_UI
as
APP_LOG
from
.output
import
LOG_JOB
as
TEST_LOG
#: when test was interrupted (ctrl+c/timeout)
TIMEOUT_TEST_INTERRUPTED
=
60
#: when the process died but the status was not yet delivered
TIMEOUT_PROCESS_DIED
=
10
#: when test reported status but the process did not finish
TIMEOUT_PROCESS_ALIVE
=
60
def
add_runner_failure
(
test_state
,
new_status
,
message
):
"""
...
...
@@ -216,18 +211,26 @@ class TestStatus:
notifications)
"""
# Wait for either process termination or test status
wait
.
wait_for
(
lambda
:
not
proc
.
is_alive
()
or
self
.
status
,
1
,
0
,
step
)
wait
.
wait_for
(
lambda
:
not
proc
.
is_alive
()
or
self
.
status
,
1
,
0
,
step
)
if
self
.
status
:
# status exists, wait for process to finish
deadline
=
min
(
deadline
,
time
.
time
()
+
TIMEOUT_PROCESS_ALIVE
)
timeout_process_alive
=
settings
.
get_value
(
'runner.timeout'
,
'process_alive'
,
key_type
=
int
,
default
=
defaults
.
TIMEOUT_PROCESS_ALIVE
)
deadline
=
min
(
deadline
,
time
.
time
()
+
timeout_process_alive
)
while
time
.
time
()
<
deadline
:
result_dispatcher
.
map_method
(
'test_progress'
,
False
)
if
wait
.
wait_for
(
lambda
:
not
proc
.
is_alive
(),
1
,
0
,
step
):
if
wait
.
wait_for
(
lambda
:
not
proc
.
is_alive
(),
1
,
0
,
step
):
return
self
.
_add_status_failures
(
self
.
status
)
err
=
"Test reported status but did not finish"
else
:
# proc finished, wait for late status delivery
deadline
=
min
(
deadline
,
time
.
time
()
+
TIMEOUT_PROCESS_DIED
)
timeout_process_died
=
settings
.
get_value
(
'runner.timeout'
,
'process_died'
,
key_type
=
int
,
default
=
defaults
.
TIMEOUT_PROCESS_DIED
)
deadline
=
min
(
deadline
,
time
.
time
()
+
timeout_process_died
)
while
time
.
time
()
<
deadline
:
result_dispatcher
.
map_method
(
'test_progress'
,
False
)
if
wait
.
wait_for
(
lambda
:
self
.
status
,
1
,
0
,
step
):
...
...
@@ -468,7 +471,11 @@ class TestRunner:
# Get/update the test status (decrease timeout on abort)
if
abort_reason
:
finish_deadline
=
TIMEOUT_TEST_INTERRUPTED
+
time
.
time
()
finish_deadline
=
time
.
time
()
+
settings
.
get_value
(
'runner.timeout'
,
'after_interrupted'
,
key_type
=
int
,
default
=
defaults
.
TIMEOUT_AFTER_INTERRUPTED
)
else
:
finish_deadline
=
deadline
test_state
=
test_status
.
finish
(
proc
,
time_started
,
step
,
...
...
avocado/etc/avocado/avocado.conf
浏览文件 @
8227de69
...
...
@@ -40,6 +40,17 @@ colored = True
# Use utf8 encoding (True, False, None=autodetect)
utf8
=
[
runner
.
timeout
]
# The amount of time to give to the test process after it it has been
# interrupted (such as with CTRL+C)
after_interrupted
=
60
# The amount of to wait for a test status after the process has been
# noticed to be dead
process_died
=
10
# The amount of time to wait after a test has reported status but the
# test process has not finished
process_alive
=
60
[
remoter
.
behavior
]
# __Insecure__, reject unknown SSH host keys.
# 'False' will leave you wide open to man-in-the-middle attacks!
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录