)]}'
{"rally/task/engine.py":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"9beb6a9fcd4dfb7026b91476171f2d5d9bc2a4ca","unresolved":false,"context_lines":[{"line_number":249,"context_line":"                    with ResultConsumer(runner_obj, sla_checker,"},{"line_number":250,"context_line":"                                        self.abort_on_sla_failure) as consumer:"},{"line_number":251,"context_line":"                        try:"},{"line_number":252,"context_line":"                            with rutils.Timer() as timer:"},{"line_number":253,"context_line":"                                with context.ContextManager(context_obj):"},{"line_number":254,"context_line":"                                    duration \u003d runner_obj.run("},{"line_number":255,"context_line":"                                        name, context_obj, kw.get(\"args\", {}))"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_f8a271ad","line":252,"updated":"2015-08-06 05:14:37.000000000","message":"Move work with Timer inside the ResultConsumer","commit_id":"e7f0222890c7fc3df6246c97f2a347f58ca525ab"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"9beb6a9fcd4dfb7026b91476171f2d5d9bc2a4ca","unresolved":false,"context_lines":[{"line_number":251,"context_line":"                        try:"},{"line_number":252,"context_line":"                            with rutils.Timer() as timer:"},{"line_number":253,"context_line":"                                with context.ContextManager(context_obj):"},{"line_number":254,"context_line":"                                    duration \u003d runner_obj.run("},{"line_number":255,"context_line":"                                        name, context_obj, kw.get(\"args\", {}))"},{"line_number":256,"context_line":"                        finally:"},{"line_number":257,"context_line":"                            full_duration \u003d timer.duration()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_98948d43","line":254,"updated":"2015-08-06 05:14:37.000000000","message":"We can add to runner_obj (rally.task.runner.ScenarioRunner class) .get_load_duration() method that will return the same value.","commit_id":"e7f0222890c7fc3df6246c97f2a347f58ca525ab"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"9beb6a9fcd4dfb7026b91476171f2d5d9bc2a4ca","unresolved":false,"context_lines":[{"line_number":258,"context_line":"                except Exception as e:"},{"line_number":259,"context_line":"                    LOG.exception(e)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"                self.task.append_results(key, {\"raw\": consumer.results,"},{"line_number":262,"context_line":"                                               \"load_duration\": duration,"},{"line_number":263,"context_line":"                                               \"full_duration\": full_duration,"},{"line_number":264,"context_line":"                                               \"sla\": sla_checker.results()})"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_b855c9c2","line":261,"updated":"2015-08-06 05:14:37.000000000","message":"If we move to ResultConsumer 2 things above we will be able to move task.appen_results to ResultConsumer as well. \n\n\nSo code from 241 to 264 will look like: \n\n  runner_obj \u003d self._get_runner(kw)\n  context_obj \u003d self._prepare_context(kw.get(\"context\", {}), name, self.admin)\n  sla_checker \u003d sla.SLAChecker(kw)\n\n  try:\n    with ResultConsumer(runner_obj, context_obj, sla_checker, \n                        self.abort_on_sla_failure) as consumer: \n      with context.ContextManager(context_obj):\n          runner_obj.run(name, context_obj, kw.get(\"args\", {})))\n  except Exception as e: \n    LOG.exception(e)","commit_id":"e7f0222890c7fc3df6246c97f2a347f58ca525ab"},{"author":{"_account_id":8491,"name":"Illia Khudoshyn","email":"ikhudoshyn@mirantis.com","username":"ikhudoshyn"},"change_message_id":"45bafa3f0b9a9d48ecdd440ee748006b76a5e610","unresolved":false,"context_lines":[{"line_number":258,"context_line":"                except Exception as e:"},{"line_number":259,"context_line":"                    LOG.exception(e)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"                self.task.append_results(key, {\"raw\": consumer.results,"},{"line_number":262,"context_line":"                                               \"load_duration\": duration,"},{"line_number":263,"context_line":"                                               \"full_duration\": full_duration,"},{"line_number":264,"context_line":"                                               \"sla\": sla_checker.results()})"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_4a4ffd6a","line":261,"in_reply_to":"1a4dcd0f_b855c9c2","updated":"2015-08-06 11:00:09.000000000","message":"Done","commit_id":"e7f0222890c7fc3df6246c97f2a347f58ca525ab"},{"author":{"_account_id":12395,"name":"Roman Vasylets","email":"pomeo92@gmail.com","username":"rvasilets"},"change_message_id":"5b49ea71d14b72d37b506cb7236a26b6ae526414","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                try:"},{"line_number":243,"context_line":"                    with consumer.ResultConsumer(key, self.task, runner_obj,"},{"line_number":244,"context_line":"                                                 self.abort_on_sla_failure):"},{"line_number":245,"context_line":"                        with context.ContextManager(context_obj):"},{"line_number":246,"context_line":"                            runner_obj.run("},{"line_number":247,"context_line":"                                name, context_obj, kw.get(\"args\", {}))"},{"line_number":248,"context_line":"                except Exception as e:"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_9979d8ca","line":245,"updated":"2015-08-06 14:27:10.000000000","message":"This library might help to reduce number of lines https://docs.python.org/2/library/contextlib.html#contextlib.nested","commit_id":"1fba797346e9a78c769bc32e6c04f4c4add8ee48"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"2c3556cb14ef1dd90dc4998817a02fba59c93313","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        :param key: Scenario identifier"},{"line_number":82,"context_line":"        :param task: Task to run"},{"line_number":83,"context_line":"        :param runner_obj: ScenarioRunner object that produces results to be"},{"line_number":84,"context_line":"                           consumed"},{"line_number":85,"context_line":"        :param abort_on_sla_failure: True if the execution should be stopped"},{"line_number":86,"context_line":"                                     when some SLA check fails"}],"source_content_type":"text/x-python","patch_set":13,"id":"1a4dcd0f_1c7eed69","line":83,"updated":"2015-08-07 09:57:48.000000000","message":"s/runner_obj/runner/\n\nAlso I recommend s/object/instance/","commit_id":"b52f1c86a8751b362106a7885729cb200308ce76"},{"author":{"_account_id":8491,"name":"Illia Khudoshyn","email":"ikhudoshyn@mirantis.com","username":"ikhudoshyn"},"change_message_id":"01c60f799ed1e5a377ac9f091fec28f6a82d8b5c","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        :param key: Scenario identifier"},{"line_number":82,"context_line":"        :param task: Task to run"},{"line_number":83,"context_line":"        :param runner_obj: ScenarioRunner object that produces results to be"},{"line_number":84,"context_line":"                           consumed"},{"line_number":85,"context_line":"        :param abort_on_sla_failure: True if the execution should be stopped"},{"line_number":86,"context_line":"                                     when some SLA check fails"}],"source_content_type":"text/x-python","patch_set":13,"id":"1a4dcd0f_90e0a12a","line":83,"in_reply_to":"1a4dcd0f_1c7eed69","updated":"2015-08-07 09:59:46.000000000","message":"Done","commit_id":"b52f1c86a8751b362106a7885729cb200308ce76"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"9fc7627b191081198213eb51158dbc31f27feaf9","unresolved":false,"context_lines":[{"line_number":124,"context_line":"    def __exit__(self, exc_type, exc_value, exc_traceback):"},{"line_number":125,"context_line":"        self.finish \u003d time.time()"},{"line_number":126,"context_line":"        if exc_type:"},{"line_number":127,"context_line":"            self.unexpected_failure[\"exc\"] \u003d exc_value"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        self.is_done.set()"},{"line_number":130,"context_line":"        self.thread.join()"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a4dcd0f_f0d1c630","line":127,"updated":"2015-08-07 20:12:18.000000000","message":"Passing around unexpected_failure like this is confusing to me. Why can\u0027t you just call set_unexpected_failure() here in __exit__() instead of setting unexpected_failure and counting on the thread to call set_unexpected_failure()? This seems prone to race conditions, in addition to being difficult to follow.","commit_id":"a3f8ffbadbd430090d9b1813fd9a92f7bcb23113"},{"author":{"_account_id":8491,"name":"Illia Khudoshyn","email":"ikhudoshyn@mirantis.com","username":"ikhudoshyn"},"change_message_id":"a87934726e5f15452d420c6ec7cd0a585581e058","unresolved":false,"context_lines":[{"line_number":124,"context_line":"    def __exit__(self, exc_type, exc_value, exc_traceback):"},{"line_number":125,"context_line":"        self.finish \u003d time.time()"},{"line_number":126,"context_line":"        if exc_type:"},{"line_number":127,"context_line":"            self.unexpected_failure[\"exc\"] \u003d exc_value"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        self.is_done.set()"},{"line_number":130,"context_line":"        self.thread.join()"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a4dcd0f_26e4aa39","line":127,"in_reply_to":"1a4dcd0f_f0d1c630","updated":"2015-08-10 10:33:49.000000000","message":"Good point, tnx. Will do","commit_id":"a3f8ffbadbd430090d9b1813fd9a92f7bcb23113"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"9fc7627b191081198213eb51158dbc31f27feaf9","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        self.task.update_status(consts.TaskStatus.RUNNING)"},{"line_number":299,"context_line":"        for name in self.config:"},{"line_number":300,"context_line":"            for n, kw in enumerate(self.config[name]):"},{"line_number":301,"context_line":"                key \u003d {\"name\": name, \"pos\": n, \"kw\": kw}"},{"line_number":302,"context_line":"                LOG.info(\"Running benchmark with key: \\n%s\""},{"line_number":303,"context_line":"                         % json.dumps(key, indent\u003d2))"},{"line_number":304,"context_line":"                runner_obj \u003d self._get_runner(kw)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a4dcd0f_d0128a09","line":301,"updated":"2015-08-07 20:12:18.000000000","message":"If we\u0027re refactoring it\u0027d be nice to use real variable names here to increase readability.","commit_id":"a3f8ffbadbd430090d9b1813fd9a92f7bcb23113"},{"author":{"_account_id":8491,"name":"Illia Khudoshyn","email":"ikhudoshyn@mirantis.com","username":"ikhudoshyn"},"change_message_id":"a87934726e5f15452d420c6ec7cd0a585581e058","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        self.task.update_status(consts.TaskStatus.RUNNING)"},{"line_number":299,"context_line":"        for name in self.config:"},{"line_number":300,"context_line":"            for n, kw in enumerate(self.config[name]):"},{"line_number":301,"context_line":"                key \u003d {\"name\": name, \"pos\": n, \"kw\": kw}"},{"line_number":302,"context_line":"                LOG.info(\"Running benchmark with key: \\n%s\""},{"line_number":303,"context_line":"                         % json.dumps(key, indent\u003d2))"},{"line_number":304,"context_line":"                runner_obj \u003d self._get_runner(kw)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a4dcd0f_a62afa2a","line":301,"in_reply_to":"1a4dcd0f_d0128a09","updated":"2015-08-10 10:33:49.000000000","message":"This seems to go deeper than what I planned to refactor. Let\u0027s just keep it as it is.","commit_id":"a3f8ffbadbd430090d9b1813fd9a92f7bcb23113"}],"rally/task/runner.py":[{"author":{"_account_id":12395,"name":"Roman Vasylets","email":"pomeo92@gmail.com","username":"rvasilets"},"change_message_id":"1bcb52a9ffd4ac65457bac5207e6c29712d83984","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        with rutils.Timer() as timer:"},{"line_number":222,"context_line":"            self._run_scenario(cls, method_name, context, args)"},{"line_number":223,"context_line":"        run_duration \u003d timer.duration()"},{"line_number":224,"context_line":"        return run_duration"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def abort(self):"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_f414a34d","line":223,"updated":"2015-08-06 14:45:00.000000000","message":"Need to use \u0027self\u0027 here","commit_id":"1fba797346e9a78c769bc32e6c04f4c4add8ee48"},{"author":{"_account_id":8491,"name":"Illia Khudoshyn","email":"ikhudoshyn@mirantis.com","username":"ikhudoshyn"},"change_message_id":"d8b66bfb1ad4f4ebc716f6d760caf00e45762420","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        with rutils.Timer() as timer:"},{"line_number":222,"context_line":"            self._run_scenario(cls, method_name, context, args)"},{"line_number":223,"context_line":"        run_duration \u003d timer.duration()"},{"line_number":224,"context_line":"        return run_duration"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def abort(self):"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_4fc62269","line":223,"in_reply_to":"1a4dcd0f_f414a34d","updated":"2015-08-06 14:53:15.000000000","message":"Done","commit_id":"1fba797346e9a78c769bc32e6c04f4c4add8ee48"}],"tests/unit/task/test_engine.py":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"9beb6a9fcd4dfb7026b91476171f2d5d9bc2a4ca","unresolved":false,"context_lines":[{"line_number":385,"context_line":"        runner.result_queue \u003d collections.deque([1, 2])"},{"line_number":386,"context_line":"        with engine.ResultConsumer("},{"line_number":387,"context_line":"                runner, mock_sla_checker, False) as consumer:"},{"line_number":388,"context_line":"            time.sleep(1)"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"        expected_iteration_calls \u003d [mock.call(1), mock.call(2)]"},{"line_number":391,"context_line":"        self.assertEqual(expected_iteration_calls,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_b83e2989","line":388,"updated":"2015-08-06 05:14:37.000000000","message":"Actually we should split testing of engine.run() and ResultConsumer() tests. \n\nE.g. remove everything not related to run() from this class (mock ResultConsumer and create ResultConsumerTestCase and include all required tests)","commit_id":"e7f0222890c7fc3df6246c97f2a347f58ca525ab"},{"author":{"_account_id":8491,"name":"Illia Khudoshyn","email":"ikhudoshyn@mirantis.com","username":"ikhudoshyn"},"change_message_id":"45bafa3f0b9a9d48ecdd440ee748006b76a5e610","unresolved":false,"context_lines":[{"line_number":385,"context_line":"        runner.result_queue \u003d collections.deque([1, 2])"},{"line_number":386,"context_line":"        with engine.ResultConsumer("},{"line_number":387,"context_line":"                runner, mock_sla_checker, False) as consumer:"},{"line_number":388,"context_line":"            time.sleep(1)"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"        expected_iteration_calls \u003d [mock.call(1), mock.call(2)]"},{"line_number":391,"context_line":"        self.assertEqual(expected_iteration_calls,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_ca430d41","line":388,"in_reply_to":"1a4dcd0f_b83e2989","updated":"2015-08-06 11:00:09.000000000","message":"Done","commit_id":"e7f0222890c7fc3df6246c97f2a347f58ca525ab"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"0fe1e7a1a9fec27b27049c676a4b7c1d3773dd96","unresolved":false,"context_lines":[{"line_number":410,"context_line":"        runner.result_queue \u003d collections.deque([1, 2, 3, 4])"},{"line_number":411,"context_line":""},{"line_number":412,"context_line":"        with engine.ResultConsumer(key, task, runner, True):"},{"line_number":413,"context_line":"            time.sleep(1)"},{"line_number":414,"context_line":""},{"line_number":415,"context_line":"        self.assertTrue(runner.abort.called)"},{"line_number":416,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a4dcd0f_78cdd32f","line":413,"updated":"2015-08-06 21:13:11.000000000","message":"Do not call sleep inside tests. \nThis slows down unit testing and seems useless. \n\nIf you have to check that duration of process are captured properly you should rather mock time.time.","commit_id":"b01dbcd6ede2fd1a98d74ea03990a97ca497b96a"},{"author":{"_account_id":8491,"name":"Illia Khudoshyn","email":"ikhudoshyn@mirantis.com","username":"ikhudoshyn"},"change_message_id":"c28253d9b68708df61363a754ee05cc76ad9dabb","unresolved":false,"context_lines":[{"line_number":410,"context_line":"        runner.result_queue \u003d collections.deque([1, 2, 3, 4])"},{"line_number":411,"context_line":""},{"line_number":412,"context_line":"        with engine.ResultConsumer(key, task, runner, True):"},{"line_number":413,"context_line":"            time.sleep(1)"},{"line_number":414,"context_line":""},{"line_number":415,"context_line":"        self.assertTrue(runner.abort.called)"},{"line_number":416,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a4dcd0f_fb7a2b76","line":413,"in_reply_to":"1a4dcd0f_78cdd32f","updated":"2015-08-07 08:27:33.000000000","message":"Done","commit_id":"b01dbcd6ede2fd1a98d74ea03990a97ca497b96a"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"9fc7627b191081198213eb51158dbc31f27feaf9","unresolved":false,"context_lines":[{"line_number":468,"context_line":""},{"line_number":469,"context_line":"        expected_set_failure_calls \u003d [mock.call(exc)]"},{"line_number":470,"context_line":"        self.assertEqual(expected_set_failure_calls,"},{"line_number":471,"context_line":"                         mock_sla_instance.set_unexpected_failure.mock_calls)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a4dcd0f_10931251","line":471,"updated":"2015-08-07 20:12:18.000000000","message":"Instead use:\n\n    mock_sla_instance.set_unexpected_failure.assert_has_calls(...)","commit_id":"a3f8ffbadbd430090d9b1813fd9a92f7bcb23113"},{"author":{"_account_id":8491,"name":"Illia Khudoshyn","email":"ikhudoshyn@mirantis.com","username":"ikhudoshyn"},"change_message_id":"a87934726e5f15452d420c6ec7cd0a585581e058","unresolved":false,"context_lines":[{"line_number":468,"context_line":""},{"line_number":469,"context_line":"        expected_set_failure_calls \u003d [mock.call(exc)]"},{"line_number":470,"context_line":"        self.assertEqual(expected_set_failure_calls,"},{"line_number":471,"context_line":"                         mock_sla_instance.set_unexpected_failure.mock_calls)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a4dcd0f_2617caee","line":471,"in_reply_to":"1a4dcd0f_10931251","updated":"2015-08-10 10:33:49.000000000","message":"Done","commit_id":"a3f8ffbadbd430090d9b1813fd9a92f7bcb23113"}]}
