diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index cfbbfe12e..86d8bdbfe 100644 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -14,6 +14,7 @@ Fix --- - Add default value for ``FLOW_PROCESSES_ALLOW_LIST`` and ``FLOW_PROCESSES_IGNORE_LIST`` in case of missing settings. +- Fix null executor warnings =================== diff --git a/resolwe/flow/executors/null/prepare.py b/resolwe/flow/executors/null/prepare.py index 784d37bdb..d6f4ad50d 100644 --- a/resolwe/flow/executors/null/prepare.py +++ b/resolwe/flow/executors/null/prepare.py @@ -7,18 +7,8 @@ :meth:`~resolwe.flow.executors.prepare.BaseFlowExecutorPreparer.extend_settings` method. """ -from resolwe.flow.models import Worker - from ..prepare import BaseFlowExecutorPreparer # noqa: F401 class FlowExecutorPreparer(BaseFlowExecutorPreparer): """Specialized manager assist for the null executor.""" - - def prepare_for_execution(self, data): - """Prepare the data object for the execution. - - Mark worker object as done. - """ - data.worker.status = Worker.STATUS_COMPLETED - data.worker.save() diff --git a/resolwe/flow/executors/null/run.py b/resolwe/flow/executors/null/run.py index 40a88e3bf..4efbe6c85 100644 --- a/resolwe/flow/executors/null/run.py +++ b/resolwe/flow/executors/null/run.py @@ -20,5 +20,5 @@ class FlowExecutor(BaseFlowExecutor): name = "null" async def run(self): - """Do nothing :).""" - pass + """Notify listener run is completed.""" + await self.communicator.finish({"rc": 0}) diff --git a/resolwe/flow/tests/test_executors.py b/resolwe/flow/tests/test_executors.py index 6c7437262..98d105f1e 100644 --- a/resolwe/flow/tests/test_executors.py +++ b/resolwe/flow/tests/test_executors.py @@ -602,12 +602,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, {})