{"action":"created","issue":{"url":"https://api.github.com/repos/cucumber/cucumber-js/issues/341","labels_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/341/labels{/name}","comments_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/341/comments","events_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/341/events","html_url":"https://github.com/cucumber/cucumber-js/issues/341","id":83683460,"number":341,"title":"World is undefined in After hook?","user":{"login":"bigattichouse","id":67535,"avatar_url":"https://avatars.githubusercontent.com/u/67535?v=3","gravatar_id":"","url":"https://api.github.com/users/bigattichouse","html_url":"https://github.com/bigattichouse","followers_url":"https://api.github.com/users/bigattichouse/followers","following_url":"https://api.github.com/users/bigattichouse/following{/other_user}","gists_url":"https://api.github.com/users/bigattichouse/gists{/gist_id}","starred_url":"https://api.github.com/users/bigattichouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigattichouse/subscriptions","organizations_url":"https://api.github.com/users/bigattichouse/orgs","repos_url":"https://api.github.com/users/bigattichouse/repos","events_url":"https://api.github.com/users/bigattichouse/events{/privacy}","received_events_url":"https://api.github.com/users/bigattichouse/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cucumber/cucumber-js/labels/bug","name":"bug","color":"FFBAB3"},{"url":"https://api.github.com/repos/cucumber/cucumber-js/labels/debug%20request","name":"debug request","color":"f7c6c7"},{"url":"https://api.github.com/repos/cucumber/cucumber-js/labels/undecided","name":"undecided","color":"DDDDDD"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-01T20:40:35Z","updated_at":"2015-09-13T03:01:34Z","closed_at":null,"body":"After upgrading recently to the most recent version of cucumber.js I noticed that the test was hanging even though it succeeded (all tests pass).  I'm using zombie within the world file similarly to the cucumber examples.\r\n\r\nThe eventual error:\r\nCucumber process timed out after waiting 60 seconds for the node.js event loop to empty.  There may be a resource leak.  Have all resources like database connections and network connections been closed properly?\r\n\r\nSo, I thought - well, I'll just stick an After hook to close the browser:\r\n\r\nthis.After(function(callback) {\r\n    this.browser.close();\r\n    callback();\r\n  });\r\n\r\nwhich fails ?!?\r\n\r\nTypeError: undefined is not a function\r\n\r\nBUT ... if I include the same call in the final step of my scenario - it works\r\n\r\nthis.Then(/^the user can see correct values in the output$/, function (callback) {\r\n         //assertions go here\r\n          this.browser.close();\r\n          callback();\r\n});\r\n\r\nThen my tests pass, everything is fine, and execution completes normally\r\n\r\nAm I missing something?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/cucumber/cucumber-js/issues/comments/139840924","html_url":"https://github.com/cucumber/cucumber-js/issues/341#issuecomment-139840924","issue_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/341","id":139840924,"user":{"login":"bigattichouse","id":67535,"avatar_url":"https://avatars.githubusercontent.com/u/67535?v=3","gravatar_id":"","url":"https://api.github.com/users/bigattichouse","html_url":"https://github.com/bigattichouse","followers_url":"https://api.github.com/users/bigattichouse/followers","following_url":"https://api.github.com/users/bigattichouse/following{/other_user}","gists_url":"https://api.github.com/users/bigattichouse/gists{/gist_id}","starred_url":"https://api.github.com/users/bigattichouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigattichouse/subscriptions","organizations_url":"https://api.github.com/users/bigattichouse/orgs","repos_url":"https://api.github.com/users/bigattichouse/repos","events_url":"https://api.github.com/users/bigattichouse/events{/privacy}","received_events_url":"https://api.github.com/users/bigattichouse/received_events","type":"User","site_admin":false},"created_at":"2015-09-13T03:01:34Z","updated_at":"2015-09-13T03:01:34Z","body":"One of the previous updates seems to have fixed it. I think it was due to a\nresource being left open - particularly if you have more than one browser\n(zombiejs) open, and don't explicity call close() first.\n\nSo, please. close.\n\nOn Sat, Sep 12, 2015 at 9:34 PM, Charlie Rudolph <notifications@github.com>\nwrote:\n\n> @bigattichouse <https://github.com/bigattichouse> any update on this or\n> can this be closed?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/cucumber/cucumber-js/issues/341#issuecomment-139840233>\n> .\n>\n"}}