Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
f4dd4f5a
Commit
f4dd4f5a
authored
10 years ago
by
bigbes
Browse files
Options
Downloads
Patches
Plain Diff
Error handler for ||_Process, reject file in test-status.
parent
fdcb07bc
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
test/lib/parallel.py
+23
-23
23 additions, 23 deletions
test/lib/parallel.py
test/test-run.py
+1
-1
1 addition, 1 deletion
test/test-run.py
with
25 additions
and
24 deletions
.gitignore
+
1
−
0
View file @
f4dd4f5a
...
...
@@ -7,6 +7,7 @@ _CPack_Packages
*.gcda
*.o
*.reject
*.reject_*
*.so
*~
.gitignore
...
...
This diff is collapsed.
Click to expand it.
test/lib/parallel.py
+
23
−
23
View file @
f4dd4f5a
...
...
@@ -48,19 +48,22 @@ class Parallel_Process(MProcess):
super
(
Parallel_Process
,
self
).
__init__
(
**
kwargs
)
def
run
(
self
):
queuein
=
self
.
_args
[
0
]
queueout
=
self
.
_args
[
1
]
while
True
:
logger
.
debug
(
"
||_process.run > getting job
"
)
obj
=
queuein
.
get
()
logger
.
debug
(
"
||_process.run > ok, it
'
s great
"
)
assert
obj
assert
len
(
obj
)
==
2
assert
callable
(
obj
[
0
])
assert
isinstance
(
obj
[
1
],
(
tuple
,
list
))
retv
=
obj
[
0
](
*
obj
[
1
])
logger
.
debug
(
"
||_process.run > job is done, let
'
s put into outqueue
"
)
queueout
.
put
(
retv
)
try
:
queuein
=
self
.
_args
[
0
]
queueout
=
self
.
_args
[
1
]
while
True
:
logger
.
debug
(
"
||_process.run > getting job
"
)
obj
=
queuein
.
get
()
logger
.
debug
(
"
||_process.run > ok, it
'
s great
"
)
assert
obj
assert
len
(
obj
)
==
2
assert
callable
(
obj
[
0
])
assert
isinstance
(
obj
[
1
],
(
tuple
,
list
))
retv
=
obj
[
0
](
*
obj
[
1
])
logger
.
debug
(
"
||_process.run > job is done, let
'
s put into outqueue
"
)
queueout
.
put
(
retv
)
except
EOFError
:
pass
class
Parallel_PoolException
(
Exception
):
def
__init__
(
self
,
message
):
...
...
@@ -206,7 +209,7 @@ class Parallel_FilteredStream(object):
return
self
.
stream
.
getvalue
()
class
TestStatus
(
object
):
def
__init__
(
self
,
status
):
def
__init__
(
self
,
status
,
reject
=
''
):
if
isinstance
(
status
,
basestring
):
status
=
status
.
lower
()
if
(
status
==
"
pass
"
):
...
...
@@ -217,6 +220,7 @@ class TestStatus(object):
status
=
2
else
:
status
=
3
self
.
reject
=
reject
self
.
status
=
status
self
.
message
=
''
...
...
@@ -267,7 +271,7 @@ class Supervisor(object):
admin
=
self
.
server
.
admin
.
ret_copy
()
yield
[
random
.
choice
(
self
.
tests
),
[
sql
,
admin
]]
def
run
(
self
):
def
run
_all
(
self
):
self
.
search_tests
()
if
self
.
count
!=
0
:
self
.
tests
*=
self
.
count
...
...
@@ -298,8 +302,8 @@ class Supervisor(object):
if
stat
.
status
!=
3
:
logger
.
info
(
'
>>>> Test %s finished
'
%
repr
(
task
.
name
))
else
:
logger
.
error
(
'
>>>> Test %s failed with %s
'
%
(
repr
(
task
.
name
),
stat
.
message
))
logger
.
error
(
'
>>>> Test %s failed with %s
(%s)
'
%
(
repr
(
task
.
name
),
stat
.
message
,
stat
.
reject
))
except
(
QueueEmpty
,
StopIteration
):
break
except
StopIteration
:
...
...
@@ -340,7 +344,7 @@ class Parallel_Test(object):
self
.
is_executed_ok
=
True
except
Exception
as
e
:
logger
.
error
(
"
||_Test.run > Exception
'
%s
'
was thrown for
'
%s
'"
%
(
type
(
e
),
str
(
e
)))
logger
.
error
(
traceback
.
format_exc
())
#
logger.error(traceback.format_exc())
with
open
(
self
.
reject
,
'
a
'
)
as
reject
:
traceback
.
print_exc
(
e
,
reject
)
self
.
diagnostics
=
str
(
e
)
...
...
@@ -374,7 +378,7 @@ class Parallel_Test(object):
where
=
"
test execution aborted, reason
'
{0}
'"
.
format
(
self
.
diagnostics
)
elif
not
self
.
is_equal_result
:
where
=
"
wrong test output
"
return
TestStatus
(
"
fail
"
).
set_message
(
where
)
return
TestStatus
(
"
fail
"
,
self
.
reject
).
set_message
(
where
)
def
__call__
(
self
,
sql
,
admin
):
try
:
...
...
@@ -389,7 +393,3 @@ class Parallel_FuncTest(Parallel_Test):
execfile
(
self
.
name
,
dict
(
locals
(),
sql
=
sql
,
admin
=
admin
))
class
Parallel_PythonTest
(
Parallel_FuncTest
):
pass
if
__name__
==
'
__main__
'
:
TarantoolServer
.
find_exe
(
'
..
'
)
Supervisor
().
run
()
This diff is collapsed.
Click to expand it.
test/test-run.py
+
1
−
1
View file @
f4dd4f5a
...
...
@@ -177,7 +177,7 @@ def main():
suite_names
=
[
suite_name
for
suite_name
in
suite_names
if
suite_name
.
find
(
options
.
args
.
stress
)
!=
-
1
]
suites
=
[
Supervisor
(
suite_name
,
options
.
args
)
for
suite_name
in
sorted
(
suite_names
)]
for
suite
in
suites
:
failed_tests
.
extend
(
suite
.
run
()
)
suite
.
run
_all
()
except
RuntimeError
as
e
:
color_stdout
(
"
\n
Fatal error: %s. Execution aborted.
\n
"
%
e
,
schema
=
'
error
'
)
if
options
.
args
.
gdb
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment