ariatosca-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxmrlv <...@git.apache.org>
Subject [GitHub] incubator-ariatosca pull request #163: introduced process grouping
Date Tue, 27 Jun 2017 13:20:07 GMT
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/163#discussion_r124257717
  
    --- Diff: tests/orchestrator/workflows/executor/test_process_executor.py ---
    @@ -71,10 +78,45 @@ def test_closed(self, executor, model):
                 executor.execute(MockContext(model, task_kwargs=dict(function='some.function')))
             assert 'closed' in exc_info.value.message
     
    +    def test_process_termination(self, executor, model, fs_test_holder):
    +        argument = models.Argument.wrap('holder_path', fs_test_holder._path)
    +        model.argument.put(argument)
    +        ctx = MockContext(
    +            model,
    +            task_kwargs=dict(
    +                function='{0}.{1}'.format(__name__, freezing_task.__name__),
    +                arguments=dict(holder_path=argument)),
    +        )
    +
    +        executor.execute(ctx)
    +
    +        @retrying.retry(retry_on_result=lambda r: r is False, stop_max_delay=60000, wait_fixed=500)
    +        def wait_for_extra_process_id():
    +            return fs_test_holder.get('subproc', False)
    +
    +        pids = [executor._tasks[ctx.task.id].proc.pid, wait_for_extra_process_id()]
    +        assert any(p.pid == pid for p in psutil.process_iter() for pid in pids)
    +        executor.terminate(ctx.task.id)
    +
    +        # Give a change to the processes to terminate
    --- End diff --
    
    chance


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message