Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
7f8ae0dc
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,发现更多精彩内容 >>
提交
7f8ae0dc
编写于
12月 07, 2015
作者:
C
Cleber Rosa
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'ldoktor/runner'
上级
87c42afb
14b2f8fb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
11 deletion
+16
-11
avocado/core/runner.py
avocado/core/runner.py
+16
-11
未找到文件。
avocado/core/runner.py
浏览文件 @
7f8ae0dc
...
...
@@ -50,6 +50,7 @@ class TestStatus(object):
self
.
queue
=
queue
self
.
_early_status
=
None
self
.
status
=
{}
self
.
interrupt
=
None
@
property
def
early_status
(
self
):
...
...
@@ -75,6 +76,12 @@ class TestStatus(object):
else
:
# Not an early_status message
queue
.
append
(
msg
)
def
__getattribute__
(
self
,
name
):
# Update state before returning the value
if
name
in
(
"status"
,
"interrupt"
):
self
.
_tick
()
return
super
(
TestStatus
,
self
).
__getattribute__
(
name
)
def
wait_for_early_status
(
self
,
proc
,
timeout
):
"""
Wait until early_status is obtained
...
...
@@ -96,12 +103,10 @@ class TestStatus(object):
raise
exceptions
.
TestError
(
msg
)
time
.
sleep
(
0
)
def
che
ck
(
self
):
def
_ti
ck
(
self
):
"""
Check if there are messages queued and handle them
:return: True if everything is ok, False on interruption (break)
Process the queue and update current status
"""
res
=
True
while
not
self
.
queue
.
empty
():
msg
=
self
.
queue
.
get
()
if
"func_at_exit"
in
msg
:
...
...
@@ -111,8 +116,7 @@ class TestStatus(object):
msg
.
get
(
"once"
,
False
))
elif
not
msg
.
get
(
"running"
,
True
):
self
.
status
=
msg
res
=
False
continue
self
.
interrupt
=
True
elif
"paused"
in
msg
:
self
.
status
=
msg
self
.
job
.
result_proxy
.
notify_progress
(
False
)
...
...
@@ -122,7 +126,6 @@ class TestStatus(object):
self
.
job
.
view
.
notify
(
event
=
'partial'
,
msg
=
reason
)
else
:
# test_status
self
.
status
=
msg
return
res
def
abort
(
self
,
test_alive
,
started
,
timeout
,
first
,
step
):
"""
...
...
@@ -133,7 +136,7 @@ class TestStatus(object):
:param first: Delay before first check
:param step: Step between checks for the status
"""
if
test_alive
and
wait
.
wait_for
(
lambda
:
not
self
.
check
()
,
timeout
,
if
test_alive
and
wait
.
wait_for
(
lambda
:
self
.
status
,
timeout
,
first
,
step
):
return
self
.
status
else
:
...
...
@@ -265,11 +268,14 @@ class TestRunner(object):
while
True
:
try
:
if
time
.
time
()
>=
deadline
:
os
.
kill
(
proc
.
pid
,
signal
.
SIGUSR1
)
try
:
os
.
kill
(
proc
.
pid
,
signal
.
SIGUSR1
)
except
OSError
:
pass
break
wait
.
wait_for
(
lambda
:
not
queue
.
empty
()
or
not
proc
.
is_alive
(),
cycle_timeout
,
first
,
step
)
if
not
test_status
.
check
()
:
if
test_status
.
interrupt
:
break
if
proc
.
is_alive
():
if
ctrl_c_count
==
0
:
...
...
@@ -299,7 +305,6 @@ class TestRunner(object):
os
.
kill
(
proc
.
pid
,
signal
.
SIGKILL
)
# Get/update the test status
test_status
.
check
()
if
test_status
.
status
:
test_state
=
test_status
.
status
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录