Skip to content

Commit

Permalink
Fix null executor
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorjerse committed Dec 2, 2024
1 parent aec76d0 commit 028a2a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
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

0 comments on commit 028a2a4

Please sign in to comment.