Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flamenco-worker-python
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
flamenco-worker-python
Commits
6acbc2cc
Commit
6acbc2cc
authored
Nov 15, 2018
by
Sybren A. Stüvel
Browse files
Options
Downloads
Patches
Plain Diff
Fix logging failed command
parent
49b53b71
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
flamenco_worker/commands.py
+4
-4
4 additions, 4 deletions
flamenco_worker/commands.py
tests/test_runner.py
+2
-2
2 additions, 2 deletions
tests/test_runner.py
with
6 additions
and
6 deletions
flamenco_worker/commands.py
+
4
−
4
View file @
6acbc2cc
...
@@ -508,12 +508,12 @@ class AbstractSubprocessCommand(AbstractCommand):
...
@@ -508,12 +508,12 @@ class AbstractSubprocessCommand(AbstractCommand):
await
self
.
worker
.
register_log
(
processed_line
)
await
self
.
worker
.
register_log
(
processed_line
)
retcode
=
await
self
.
proc
.
wait
()
retcode
=
await
self
.
proc
.
wait
()
cmdline
=
'
'
.
join
(
shlex
.
quote
(
arg
)
for
arg
in
args
)
self
.
_log
.
info
(
'
Command %s (pid=%d) stopped with status code %s
'
,
self
.
_log
.
info
(
'
Command %r (pid=%d) stopped with status code %s
'
,
cmdline
,
pid
,
retcode
)
cmd_to_log
,
pid
,
retcode
)
if
retcode
:
if
retcode
:
raise
CommandExecutionError
(
'
Command %
r
(pid=%d) failed with status %s
'
%
raise
CommandExecutionError
(
'
Command %
s
(pid=%d) failed with status %s
'
%
(
cmd
line
,
pid
,
retcode
))
(
cmd
_to_log
,
pid
,
retcode
))
except
asyncio
.
CancelledError
:
except
asyncio
.
CancelledError
:
self
.
_log
.
info
(
'
asyncio task got canceled, killing subprocess pid=%d
'
,
pid
)
self
.
_log
.
info
(
'
asyncio task got canceled, killing subprocess pid=%d
'
,
pid
)
await
self
.
abort
()
await
self
.
abort
()
...
...
This diff is collapsed.
Click to expand it.
tests/test_runner.py
+
2
−
2
View file @
6acbc2cc
...
@@ -162,11 +162,11 @@ class ExecCommandTest(AbstractCommandTest):
...
@@ -162,11 +162,11 @@ class ExecCommandTest(AbstractCommandTest):
'
%s -c
\'
raise SystemExit(
"
¡FAIL!
"
)
\'
'
%
sys
.
executable
),
'
%s -c
\'
raise SystemExit(
"
¡FAIL!
"
)
\'
'
%
sys
.
executable
),
call
(
'
pid=%d > ¡FAIL!
'
%
pid
),
# note the logged line doesn't end in a newline
call
(
'
pid=%d > ¡FAIL!
'
%
pid
),
# note the logged line doesn't end in a newline
call
(
'
exec.(task_id=12345, command_idx=0): Error executing:
'
call
(
'
exec.(task_id=12345, command_idx=0): Error executing:
'
'
Command pid=%d failed with status 1
'
%
pid
)
'
Command
%s (
pid=%d
)
failed with status 1
'
%
(
settings
[
'
cmd
'
],
pid
)
)
])
])
# The update should NOT contain a new task status -- that is left to the Worker.
# The update should NOT contain a new task status -- that is left to the Worker.
self
.
fworker
.
register_task_update
.
assert_called_with
(
self
.
fworker
.
register_task_update
.
assert_called_with
(
activity
=
'
exec.(task_id=12345, command_idx=0): Error executing:
'
activity
=
'
exec.(task_id=12345, command_idx=0): Error executing:
'
'
Command pid=%d failed with status 1
'
%
pid
,
'
Command
%s (
pid=%d
)
failed with status 1
'
%
(
settings
[
'
cmd
'
],
pid
)
,
)
)
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