Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ Change Log
All notable changes to this project will be documented in this file.
This project adheres to `Semantic Versioning <http://semver.org/>`__.

[37.0.0] - 2021-02-19
---------------------
Changed
~~~~~~~
- ``run_task`` now exits with the exit code from the task.
- ``reversed_statuses`` works now, with statuses of 245 and 241.

[36.0.5] - 2021-02-11
---------------------
Changed
Expand Down
2 changes: 1 addition & 1 deletion src/scriptworker/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"reclaim_interval": 300,
"poll_interval": 10,
"sign_key_timeout": 60 * 2,
"reversed_statuses": immutabledict({-11: STATUSES["intermittent-task"], -15: STATUSES["intermittent-task"]}),
"reversed_statuses": immutabledict({245: "intermittent-task", 241: "intermittent-task"}),
# Report this status on max_timeout. `intermittent-task` will rerun the
# task automatically. `internal-error` or other will require manual
# intervention.
Expand Down
2 changes: 1 addition & 1 deletion src/scriptworker/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ async def run_task(context, to_cancellable_process):
if stopped_due_to_worker_shutdown:
raise WorkerShutdownDuringTask

return 1 if exitcode != 0 else 0
return exitcode


# reclaim_task {{{1
Expand Down
2 changes: 1 addition & 1 deletion src/scriptworker/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_version_string(version: Union[ShortVerType, LongVerType]) -> str:

# 1}}}
# Semantic versioning 2.0.0 http://semver.org/
__version__ = (36, 0, 5)
__version__ = (37, 0, 0)
__version_string__ = get_version_string(__version__)


Expand Down
8 changes: 8 additions & 0 deletions tests/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,14 @@ async def test_reportException(context, successful_queue):
assert successful_queue.info == ["reportException", ("taskId", "runId", {"reason": "worker-shutdown"}), {}]


@pytest.mark.parametrize("exit_code", (245, 241))
@pytest.mark.asyncio
async def test_reversed_statuses(context, successful_queue, exit_code):
context.temp_queue = successful_queue
await swtask.complete_task(context, exit_code)
assert successful_queue.info == ["reportException", ("taskId", "runId", {"reason": context.config["reversed_statuses"][exit_code]}), {}]


# complete_task {{{1
@pytest.mark.asyncio
async def test_complete_task_409(context, unsuccessful_queue):
Expand Down
6 changes: 3 additions & 3 deletions version.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"version":[
36,
37,
0,
5
0
],
"version_string":"36.0.5"
"version_string":"37.0.0"
}