|  | 
| 26 | 26 | from aiida.engine import Process, ProcessState | 
| 27 | 27 | from aiida.engine.processes import control as process_control | 
| 28 | 28 | from aiida.engine.utils import exponential_backoff_retry | 
| 29 |  | -from aiida.orm import CalcJobNode, Group, WorkChainNode, WorkflowNode, WorkFunctionNode | 
|  | 29 | +from aiida.orm import CalcJobNode, Group, Int, WorkChainNode, WorkflowNode, WorkFunctionNode | 
| 30 | 30 | from tests.utils.processes import WaitProcess | 
| 31 | 31 | 
 | 
| 32 | 32 | FuncArgs = tuple[t.Any, ...] | 
| @@ -152,7 +152,6 @@ def test_process_kill_failing_transport( | 
| 152 | 152 |     A failure in opening a transport connection results in the EBM to be fired blocking a regular kill command. | 
| 153 | 153 |     The force kill command will ignore the EBM and kill the process in any case.""" | 
| 154 | 154 |     from aiida.cmdline.utils.common import get_process_function_report | 
| 155 |  | -    from aiida.orm import Int | 
| 156 | 155 | 
 | 
| 157 | 156 |     code = aiida_code_installed(default_calc_job_plugin='core.arithmetic.add', filepath_executable='/bin/bash') | 
| 158 | 157 | 
 | 
| @@ -193,7 +192,6 @@ def test_process_kill_failing_transport_failed_kill( | 
| 193 | 192 |     """ | 
| 194 | 193 | 
 | 
| 195 | 194 |     from aiida.cmdline.utils.common import get_process_function_report | 
| 196 |  | -    from aiida.orm import Int | 
| 197 | 195 | 
 | 
| 198 | 196 |     code = aiida_code_installed(default_calc_job_plugin='core.arithmetic.add', filepath_executable='/bin/bash') | 
| 199 | 197 | 
 | 
| @@ -235,8 +233,6 @@ def test_process_kill_failing_ebm_transport( | 
| 235 | 233 |     It should be possible to kill it normally. A process that failed upload (e.g. in scenarios that transport is working | 
| 236 | 234 |     again) and is then killed | 
| 237 | 235 |     """ | 
| 238 |  | -    from aiida.orm import Int | 
| 239 |  | - | 
| 240 | 236 |     code = aiida_code_installed(default_calc_job_plugin='core.arithmetic.add', filepath_executable='/bin/bash') | 
| 241 | 237 | 
 | 
| 242 | 238 |     def make_a_builder(sleep_seconds=0): | 
| @@ -275,7 +271,7 @@ def test_process_kill_failing_ebm_kill( | 
| 275 | 271 |     Killing a process tries to gracefully cancel the job on the remote node. If there are connection problems it retries | 
| 276 | 272 |     it in using the EBM. If this fails another kill command can be send to restart the cancelation of the job scheduler. | 
| 277 | 273 |     """ | 
| 278 |  | -    from aiida.orm import Int | 
|  | 274 | +    from aiida.cmdline.utils.common import get_process_function_report | 
| 279 | 275 | 
 | 
| 280 | 276 |     code = aiida_code_installed(default_calc_job_plugin='core.arithmetic.add', filepath_executable='/bin/bash') | 
| 281 | 277 | 
 | 
| @@ -306,7 +302,11 @@ def make_a_builder(sleep_seconds=0): | 
| 306 | 302 |         # kill should restart EBM and be not successful in EBM | 
| 307 | 303 |         # this tests if the old task is cancelled and restarted successfully | 
| 308 | 304 |         run_cli_command(cmd_process.process_kill, [str(node.pk), '--wait']) | 
| 309 |  | -        await_condition(lambda: not node.is_killed, timeout=kill_timeout) | 
|  | 305 | +        await_condition( | 
|  | 306 | +            lambda: 'Found active scheduler job cancelation that will be rescheduled.' | 
|  | 307 | +            in get_process_function_report(node), | 
|  | 308 | +            timeout=kill_timeout, | 
|  | 309 | +        ) | 
| 310 | 310 | 
 | 
| 311 | 311 |         # force kill should skip EBM and successfully kill the process | 
| 312 | 312 |         run_cli_command(cmd_process.process_kill, [str(node.pk), '-F', '--wait']) | 
| @@ -826,8 +826,6 @@ def test_process_kill(submit_and_await, run_cli_command, aiida_code_installed): | 
| 826 | 826 |     assert result.exit_code == ExitCode.USAGE_ERROR | 
| 827 | 827 |     assert len(result.output_lines) > 0 | 
| 828 | 828 | 
 | 
| 829 |  | -    from aiida.orm import Int | 
| 830 |  | - | 
| 831 | 829 |     code = aiida_code_installed(default_calc_job_plugin='core.arithmetic.add', filepath_executable='/bin/bash') | 
| 832 | 830 |     builder = code.get_builder() | 
| 833 | 831 |     builder.x = Int(2) | 
|  | 
0 commit comments