{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/kibana/pulls/comments/129521122","pull_request_review_id":52301017,"id":129521122,"diff_hunk":"@@ -98,3 +98,30 @@ test('calls onShutdown param on \"shutdown\"', async () => {\n   expect(onShutdown).toHaveBeenCalledTimes(1);\n   expect(onShutdown).toHaveBeenLastCalledWith(err);\n });\n+\n+test('calls shutdown when configuring logger fails', async () => {\n+  const logged = jest.spyOn(console, 'error');\n+  logged.mockImplementation(noop);\n+\n+  const onShutdown = jest.fn();\n+\n+  const root = new Root(config$, env, onShutdown);\n+  const err = new Error('foo bar baz');\n+\n+  configService.atPath.mockImplementationOnce(() => {\n+    throw err;\n+  });\n+\n+  mockServer.mockClear();\n+\n+  await root.start();\n+\n+  expect(mockServer).not.toHaveBeenCalled();\n+\n+  expect(onShutdown).toHaveBeenCalledTimes(1);\n+  expect(onShutdown).toHaveBeenLastCalledWith(err);\n+\n+  expect(logged.mock.calls).toMatchSnapshot();\n+\n+  logged.mockRestore();","path":"platform/root/__tests__/index.test.ts","position":29,"original_position":29,"commit_id":"f3276b444e321a193b32a3f3057ed2e838277df0","original_commit_id":"f3276b444e321a193b32a3f3057ed2e838277df0","user":{"login":"azasypkin","id":1713708,"avatar_url":"https://avatars1.githubusercontent.com/u/1713708?v=4","gravatar_id":"","url":"https://api.github.com/users/azasypkin","html_url":"https://github.com/azasypkin","followers_url":"https://api.github.com/users/azasypkin/followers","following_url":"https://api.github.com/users/azasypkin/following{/other_user}","gists_url":"https://api.github.com/users/azasypkin/gists{/gist_id}","starred_url":"https://api.github.com/users/azasypkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azasypkin/subscriptions","organizations_url":"https://api.github.com/users/azasypkin/orgs","repos_url":"https://api.github.com/users/azasypkin/repos","events_url":"https://api.github.com/users/azasypkin/events{/privacy}","received_events_url":"https://api.github.com/users/azasypkin/received_events","type":"User","site_admin":false},"body":"__issue:__ the problem with restoring globals inside the test is that when test fails spy won't be restored and the following tests will use unrestored spy. So usually one should create spies in the \"parent\" scope or inside `beforeEach` and restore in them `afterEach` (same pattern can be applied to the `process.exit` above btw).","created_at":"2017-07-26T09:17:31Z","updated_at":"2017-07-26T09:17:37Z","html_url":"https://github.com/elastic/kibana/pull/13094#discussion_r129521122","pull_request_url":"https://api.github.com/repos/elastic/kibana/pulls/13094","_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments/129521122"},"html":{"href":"https://github.com/elastic/kibana/pull/13094#discussion_r129521122"},"pull_request":{"href":"https://api.github.com/repos/elastic/kibana/pulls/13094"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/13094","id":132280353,"html_url":"https://github.com/elastic/kibana/pull/13094","diff_url":"https://github.com/elastic/kibana/pull/13094.diff","patch_url":"https://github.com/elastic/kibana/pull/13094.patch","issue_url":"https://api.github.com/repos/elastic/kibana/issues/13094","number":13094,"state":"open","locked":false,"title":"Shutdown properly if configuring logger fails","user":{"login":"kjbekkelund","id":5259,"avatar_url":"https://avatars2.githubusercontent.com/u/5259?v=4","gravatar_id":"","url":"https://api.github.com/users/kjbekkelund","html_url":"https://github.com/kjbekkelund","followers_url":"https://api.github.com/users/kjbekkelund/followers","following_url":"https://api.github.com/users/kjbekkelund/following{/other_user}","gists_url":"https://api.github.com/users/kjbekkelund/gists{/gist_id}","starred_url":"https://api.github.com/users/kjbekkelund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjbekkelund/subscriptions","organizations_url":"https://api.github.com/users/kjbekkelund/orgs","repos_url":"https://api.github.com/users/kjbekkelund/repos","events_url":"https://api.github.com/users/kjbekkelund/events{/privacy}","received_events_url":"https://api.github.com/users/kjbekkelund/received_events","type":"User","site_admin":false},"body":"Not sure if this makes sense or not (`console.log` here, instead of for example flushing the buffered logger at the end etc). Maybe do this for now, then change later if we find a better way? @azasypkin ","created_at":"2017-07-25T13:23:50Z","updated_at":"2017-07-26T09:17:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b833e5897501cc74744dd3d0b164a73f1846d6e0","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/kibana/pulls/13094/commits","review_comments_url":"https://api.github.com/repos/elastic/kibana/pulls/13094/comments","review_comment_url":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/13094/comments","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/f3276b444e321a193b32a3f3057ed2e838277df0","head":{"label":"kjbekkelund:platform/shutdown-if-configure-logger-fails","ref":"platform/shutdown-if-configure-logger-fails","sha":"f3276b444e321a193b32a3f3057ed2e838277df0","user":{"login":"kjbekkelund","id":5259,"avatar_url":"https://avatars2.githubusercontent.com/u/5259?v=4","gravatar_id":"","url":"https://api.github.com/users/kjbekkelund","html_url":"https://github.com/kjbekkelund","followers_url":"https://api.github.com/users/kjbekkelund/followers","following_url":"https://api.github.com/users/kjbekkelund/following{/other_user}","gists_url":"https://api.github.com/users/kjbekkelund/gists{/gist_id}","starred_url":"https://api.github.com/users/kjbekkelund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjbekkelund/subscriptions","organizations_url":"https://api.github.com/users/kjbekkelund/orgs","repos_url":"https://api.github.com/users/kjbekkelund/repos","events_url":"https://api.github.com/users/kjbekkelund/events{/privacy}","received_events_url":"https://api.github.com/users/kjbekkelund/received_events","type":"User","site_admin":false},"repo":{"id":45115123,"name":"kibana","full_name":"kjbekkelund/kibana","owner":{"login":"kjbekkelund","id":5259,"avatar_url":"https://avatars2.githubusercontent.com/u/5259?v=4","gravatar_id":"","url":"https://api.github.com/users/kjbekkelund","html_url":"https://github.com/kjbekkelund","followers_url":"https://api.github.com/users/kjbekkelund/followers","following_url":"https://api.github.com/users/kjbekkelund/following{/other_user}","gists_url":"https://api.github.com/users/kjbekkelund/gists{/gist_id}","starred_url":"https://api.github.com/users/kjbekkelund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjbekkelund/subscriptions","organizations_url":"https://api.github.com/users/kjbekkelund/orgs","repos_url":"https://api.github.com/users/kjbekkelund/repos","events_url":"https://api.github.com/users/kjbekkelund/events{/privacy}","received_events_url":"https://api.github.com/users/kjbekkelund/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kjbekkelund/kibana","description":"Kibana","fork":true,"url":"https://api.github.com/repos/kjbekkelund/kibana","forks_url":"https://api.github.com/repos/kjbekkelund/kibana/forks","keys_url":"https://api.github.com/repos/kjbekkelund/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kjbekkelund/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kjbekkelund/kibana/teams","hooks_url":"https://api.github.com/repos/kjbekkelund/kibana/hooks","issue_events_url":"https://api.github.com/repos/kjbekkelund/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/kjbekkelund/kibana/events","assignees_url":"https://api.github.com/repos/kjbekkelund/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/kjbekkelund/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/kjbekkelund/kibana/tags","blobs_url":"https://api.github.com/repos/kjbekkelund/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kjbekkelund/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kjbekkelund/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/kjbekkelund/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kjbekkelund/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/kjbekkelund/kibana/languages","stargazers_url":"https://api.github.com/repos/kjbekkelund/kibana/stargazers","contributors_url":"https://api.github.com/repos/kjbekkelund/kibana/contributors","subscribers_url":"https://api.github.com/repos/kjbekkelund/kibana/subscribers","subscription_url":"https://api.github.com/repos/kjbekkelund/kibana/subscription","commits_url":"https://api.github.com/repos/kjbekkelund/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/kjbekkelund/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/kjbekkelund/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/kjbekkelund/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/kjbekkelund/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/kjbekkelund/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kjbekkelund/kibana/merges","archive_url":"https://api.github.com/repos/kjbekkelund/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kjbekkelund/kibana/downloads","issues_url":"https://api.github.com/repos/kjbekkelund/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/kjbekkelund/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/kjbekkelund/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/kjbekkelund/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kjbekkelund/kibana/labels{/name}","releases_url":"https://api.github.com/repos/kjbekkelund/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/kjbekkelund/kibana/deployments","created_at":"2015-10-28T13:45:10Z","updated_at":"2016-02-11T18:53:14Z","pushed_at":"2017-07-25T16:59:04Z","git_url":"git://github.com/kjbekkelund/kibana.git","ssh_url":"git@github.com:kjbekkelund/kibana.git","clone_url":"https://github.com/kjbekkelund/kibana.git","svn_url":"https://github.com/kjbekkelund/kibana","homepage":"https://www.elastic.co/products/kibana","size":276275,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:new-platform","ref":"new-platform","sha":"da3569420039bb50aa1f94f098d5d88d3fccac7c","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":7833168,"name":"kibana","full_name":"elastic/kibana","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":false,"url":"https://api.github.com/repos/elastic/kibana","forks_url":"https://api.github.com/repos/elastic/kibana/forks","keys_url":"https://api.github.com/repos/elastic/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/kibana/teams","hooks_url":"https://api.github.com/repos/elastic/kibana/hooks","issue_events_url":"https://api.github.com/repos/elastic/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/kibana/events","assignees_url":"https://api.github.com/repos/elastic/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/kibana/tags","blobs_url":"https://api.github.com/repos/elastic/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/kibana/languages","stargazers_url":"https://api.github.com/repos/elastic/kibana/stargazers","contributors_url":"https://api.github.com/repos/elastic/kibana/contributors","subscribers_url":"https://api.github.com/repos/elastic/kibana/subscribers","subscription_url":"https://api.github.com/repos/elastic/kibana/subscription","commits_url":"https://api.github.com/repos/elastic/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/kibana/merges","archive_url":"https://api.github.com/repos/elastic/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/kibana/downloads","issues_url":"https://api.github.com/repos/elastic/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/kibana/labels{/name}","releases_url":"https://api.github.com/repos/elastic/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/kibana/deployments","created_at":"2013-01-26T04:00:59Z","updated_at":"2017-07-26T07:36:05Z","pushed_at":"2017-07-26T09:09:18Z","git_url":"git://github.com/elastic/kibana.git","ssh_url":"git@github.com:elastic/kibana.git","clone_url":"https://github.com/elastic/kibana.git","svn_url":"https://github.com/elastic/kibana","homepage":"https://www.elastic.co/products/kibana","size":279583,"stargazers_count":7700,"watchers_count":7700,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2972,"mirror_url":null,"open_issues_count":1930,"forks":2972,"open_issues":1930,"watchers":7700,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/13094"},"html":{"href":"https://github.com/elastic/kibana/pull/13094"},"issue":{"href":"https://api.github.com/repos/elastic/kibana/issues/13094"},"comments":{"href":"https://api.github.com/repos/elastic/kibana/issues/13094/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/kibana/pulls/13094/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/kibana/pulls/13094/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/kibana/statuses/f3276b444e321a193b32a3f3057ed2e838277df0"}}}}
{"actor":{"display_login":"azasypkin"}}