Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix null executor warnings #1076

Merged
merged 1 commit into from
Dec 2, 2024
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
1 change: 1 addition & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Added
Changed
-------
- Make processing container startup script ``Python`` 3.12 compatible
- Fix stop null executor processing in the preparation phase

Fixed
-----
Expand Down
8 changes: 5 additions & 3 deletions resolwe/flow/executors/null/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
method.
"""

from resolwe.flow.models import Worker
from resolwe.flow.models import Data, Worker

from ..prepare import BaseFlowExecutorPreparer # noqa: F401

Expand All @@ -19,7 +19,9 @@ class FlowExecutorPreparer(BaseFlowExecutorPreparer):
def prepare_for_execution(self, data):
"""Prepare the data object for the execution.

Mark worker object as done.
Mark data and its worker object as completed.
"""
data.status = Data.STATUS_DONE
data.worker.status = Worker.STATUS_COMPLETED
data.worker.save()
data.worker.save(update_fields=["status"])
data.save(update_fields=["status"])
3 changes: 1 addition & 2 deletions resolwe/flow/tests/test_executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,12 +791,11 @@ def test_docker_uid_gid(self):
data = self.run_process("test-docker-uid-gid")
self.assertEqual(data.output["result"], "OK")

@unittest.skip("Null executor test currently not working.")
@with_null_executor
@tag_process("test-save-number")
def test_null_executor(self):
data = self.run_process(
"test-save-number", {"number": 19}, assert_status=Data.STATUS_WAITING
"test-save-number", {"number": 19}, assert_status=Data.STATUS_DONE
)
self.assertEqual(data.input["number"], 19)
self.assertEqual(data.output, {})
Expand Down
Loading