{"action":"created","issue":{"url":"https://api.github.com/repos/start-jsk/rtmros_hironx/issues/377","labels_url":"https://api.github.com/repos/start-jsk/rtmros_hironx/issues/377/labels{/name}","comments_url":"https://api.github.com/repos/start-jsk/rtmros_hironx/issues/377/comments","events_url":"https://api.github.com/repos/start-jsk/rtmros_hironx/issues/377/events","html_url":"https://github.com/start-jsk/rtmros_hironx/pull/377","id":97013863,"number":377,"title":"Initialize hcf in setUpClass to enable retrying during hcf initialization.","user":{"login":"snozawa","id":6102287,"avatar_url":"https://avatars.githubusercontent.com/u/6102287?v=3","gravatar_id":"","url":"https://api.github.com/users/snozawa","html_url":"https://github.com/snozawa","followers_url":"https://api.github.com/users/snozawa/followers","following_url":"https://api.github.com/users/snozawa/following{/other_user}","gists_url":"https://api.github.com/users/snozawa/gists{/gist_id}","starred_url":"https://api.github.com/users/snozawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snozawa/subscriptions","organizations_url":"https://api.github.com/users/snozawa/orgs","repos_url":"https://api.github.com/users/snozawa/repos","events_url":"https://api.github.com/users/snozawa/events{/privacy}","received_events_url":"https://api.github.com/users/snozawa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-24T09:37:08Z","updated_at":"2015-07-27T08:06:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/start-jsk/rtmros_hironx/pulls/377","html_url":"https://github.com/start-jsk/rtmros_hironx/pull/377","diff_url":"https://github.com/start-jsk/rtmros_hironx/pull/377.diff","patch_url":"https://github.com/start-jsk/rtmros_hironx/pull/377.patch"},"body":"Initialize hcf in setUpClass to enable retrying during hcf initialization to pass travis tests.\r\n\r\nCurrently, hrpsys-base tests fail frequently on hironx_ros_bridge checking.\r\nIn the log(https://s3.amazonaws.com/archive.travis-ci.org/jobs/72416107/log.txt),\r\nhcf initializaion fails, but rostest seems not to be retried. \r\nThe error message says like this:\r\n```\r\nFAILURE: test [test_hironx_ros_bridge_controller] did not generate test results\r\n  File \"/usr/lib/python2.7/unittest/case.py\", line 327, in run\r\n    testMethod()\r\n  File \"/opt/ros/hydro/lib/python2.7/dist-packages/rostest/runner.py\", line 162, in fn\r\n    self.assert_(os.path.isfile(test_file), \"test [%s] did not generate test results\"%test_name)\r\n  File \"/usr/lib/python2.7/unittest/case.py\", line 420, in assertTrue\r\n    raise self.failureException(msg)\r\n```\r\nHere is corresponding code for rostest:http://code.metager.de/source/xref/ros/comm/tools/rostest/src/rostest/runner.py#161\r\nrostest does not go to retry section (results.num_errors or results.num_failures).\r\n\r\n\r\nI checked these two cases:\r\n- case1  \r\nAdd intentionally error codes to test_hironx_ros_bridge.py `setUpClass` like this:\r\n```\r\n    def setUpClass(self):\r\n           aaaaaa # for NameError: global name 'aaaaaa' is not defined\r\n```\r\nBy executing the following command, I confirmed that rostest failed and retried testing:\r\n```\r\nrostest hironx_ros_bridge test-hironx-ros-bridge-controller.test\r\n```\r\n- case 2  \r\nAdd intentionally error codes to test_hironx_ros_bridge.py `__init__` like this:\r\n```\r\n    def __init__(self, *args, **kwargs):\r\n           aaaaaa # for NameError: global name 'aaaaaa' is not defined\r\n```\r\nBy executing the following command, I confirmed that rostest failed and rostest are not retried:\r\n```\r\nrostest hironx_ros_bridge test-hironx-ros-bridge-controller.test\r\n```\r\n\r\nIn the original hrpsys-base travis log, error occurs in  `__init__` function:\r\nhttps://s3.amazonaws.com/archive.travis-ci.org/jobs/72416107/log.txt\r\nTherefore, retrying  of `test-hironx-ros-bridge-controller.test` was not executed. "},"comment":{"url":"https://api.github.com/repos/start-jsk/rtmros_hironx/issues/comments/125117265","html_url":"https://github.com/start-jsk/rtmros_hironx/pull/377#issuecomment-125117265","issue_url":"https://api.github.com/repos/start-jsk/rtmros_hironx/issues/377","id":125117265,"user":{"login":"snozawa","id":6102287,"avatar_url":"https://avatars.githubusercontent.com/u/6102287?v=3","gravatar_id":"","url":"https://api.github.com/users/snozawa","html_url":"https://github.com/snozawa","followers_url":"https://api.github.com/users/snozawa/followers","following_url":"https://api.github.com/users/snozawa/following{/other_user}","gists_url":"https://api.github.com/users/snozawa/gists{/gist_id}","starred_url":"https://api.github.com/users/snozawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snozawa/subscriptions","organizations_url":"https://api.github.com/users/snozawa/orgs","repos_url":"https://api.github.com/users/snozawa/repos","events_url":"https://api.github.com/users/snozawa/events{/privacy}","received_events_url":"https://api.github.com/users/snozawa/received_events","type":"User","site_admin":false},"created_at":"2015-07-27T08:06:11Z","updated_at":"2015-07-27T08:06:11Z","body":"Thanks.\r\n\r\n> there're classes that depends on TestHiroROSBridge (https://github.com/snozawa/rtmros_hironx/blob/fix_bug_of_retry/hironx_ros_bridge/test/test_hironx_ros_bridge_send.py), so move rtm related code to setUpClass, but keep ros related command within init, \r\n\r\nI fixed this PR according to your comment.\r\n\r\n> but keep ros related command within init\r\n\r\nI could not understand why ros related initialization should be located in `__init__`."}}