{"action":"created","issue":{"url":"https://api.github.com/repos/spotify/HubFramework/issues/227","repository_url":"https://api.github.com/repos/spotify/HubFramework","labels_url":"https://api.github.com/repos/spotify/HubFramework/issues/227/labels{/name}","comments_url":"https://api.github.com/repos/spotify/HubFramework/issues/227/comments","events_url":"https://api.github.com/repos/spotify/HubFramework/issues/227/events","html_url":"https://github.com/spotify/HubFramework/pull/227","id":194400683,"number":227,"title":"Memory management in tests","user":{"login":"cerihughes","id":12008876,"avatar_url":"https://avatars.githubusercontent.com/u/12008876?v=3","gravatar_id":"","url":"https://api.github.com/users/cerihughes","html_url":"https://github.com/cerihughes","followers_url":"https://api.github.com/users/cerihughes/followers","following_url":"https://api.github.com/users/cerihughes/following{/other_user}","gists_url":"https://api.github.com/users/cerihughes/gists{/gist_id}","starred_url":"https://api.github.com/users/cerihughes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cerihughes/subscriptions","organizations_url":"https://api.github.com/users/cerihughes/orgs","repos_url":"https://api.github.com/users/cerihughes/repos","events_url":"https://api.github.com/users/cerihughes/events{/privacy}","received_events_url":"https://api.github.com/users/cerihughes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-08T17:48:36Z","updated_at":"2016-12-08T18:40:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/spotify/HubFramework/pulls/227","html_url":"https://github.com/spotify/HubFramework/pull/227","diff_url":"https://github.com/spotify/HubFramework/pull/227.diff","patch_url":"https://github.com/spotify/HubFramework/pull/227.patch"},"body":"We need to make sure we `nil` all of our strong properties in the `tearDown` phase of unit tests.\r\n\r\n*Errrr... Why?*\r\n`XCTest` will create a new instance of your `XCTestCase` subclass for each test method in that class, and it will *not* release that test case for the lifetime of the tests being run. Maybe that's a bug in `XCTest`, or maybe it's by design. I'm not sure, but it's the way it's always been.\r\n\r\nThis means that any properties created during a test will never be released for us - `tearDown` is the only real opportunity we have to step in and release references to these instances.\r\n\r\n*But why do we care during testing?*\r\n- We want to test our `dealloc` methods too, right?\r\n- Profiling unit tests is much more difficult when every property created in every test is still alive.\r\n- If we ever introduce code that sends `NSNotification`s (for example), we'll potentially have problems where old instances could be producing / consuming events that we don't expect."},"comment":{"url":"https://api.github.com/repos/spotify/HubFramework/issues/comments/265818976","html_url":"https://github.com/spotify/HubFramework/pull/227#issuecomment-265818976","issue_url":"https://api.github.com/repos/spotify/HubFramework/issues/227","id":265818976,"user":{"login":"spotify-ci-bot","id":22506684,"avatar_url":"https://avatars.githubusercontent.com/u/22506684?v=3","gravatar_id":"","url":"https://api.github.com/users/spotify-ci-bot","html_url":"https://github.com/spotify-ci-bot","followers_url":"https://api.github.com/users/spotify-ci-bot/followers","following_url":"https://api.github.com/users/spotify-ci-bot/following{/other_user}","gists_url":"https://api.github.com/users/spotify-ci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify-ci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify-ci-bot/subscriptions","organizations_url":"https://api.github.com/users/spotify-ci-bot/orgs","repos_url":"https://api.github.com/users/spotify-ci-bot/repos","events_url":"https://api.github.com/users/spotify-ci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/spotify-ci-bot/received_events","type":"User","site_admin":false},"created_at":"2016-12-08T18:40:59Z","updated_at":"2016-12-08T18:40:59Z","body":"<table>\n  <thead>\n    <tr>\n      <th width=\"50\"></th>\n      <th width=\"100%\" data-danger-table=\"true\" data-kind=\"Message\">\n          3 Messages\n      </th>\n     </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>:book:</td>\n      <td data-sticky=\"false\">Executed 326 tests, with 0 failures (0 unexpected) in 9.480 (11.339) seconds</td>\n    </tr>\n    <tr>\n      <td>:book:</td>\n      <td data-sticky=\"false\">Executed 9 tests, with 0 failures (0 unexpected) in 156.852 (157.050) seconds</td>\n    </tr>\n    <tr>\n      <td>:book:</td>\n      <td data-sticky=\"false\">Executed 326 tests, with 0 failures (0 unexpected) in 7.686 (9.175) seconds</td>\n    </tr>\n  </tbody>\n</table>\n\n<p align=\"right\" data-meta=\"generated_by_danger\">\n  Generated by :no_entry_sign: <a href=\"http://danger.systems/\">danger</a>\n</p>\n"}}
{"actor":{"display_login":"spotify-ci-bot"}}