{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/comments/78265673","id":78265673,"diff_hunk":"@@ -703,13 +703,26 @@ public void ExcludedFunction_NotAddedToHost()\n                     { \"input\", input.ToString() }\n                 });\n \n-            await TestHelpers.Await(() =>\n+            await Task.WhenAny(t, Task.Delay(5000));\n+            if (!t.IsCompleted) throw t.Exception;\n+        }\n+\n+        [Fact]\n+        public async Task PromiseResolve()\n+        {\n+            JObject input = new JObject\n             {\n-                return t.IsCompleted;\n-            }, timeout: 5000, pollingInterval: 1000);\n+                { \"scenario\", \"promiseResolve\" }\n+            };\n+\n+            Task t = Fixture.Host.CallAsync(\"Scenarios\",\n+                new Dictionary<string, object>()\n+                {\n+                    { \"input\", input.ToString() }\n+                });\n \n-            // Await the task to force any exception to be thrown\n-            await t;\n+            await Task.WhenAny(t, Task.Delay(5000));\n+            if (!t.IsCompleted) throw t.Exception;","path":"test/WebJobs.Script.Tests/NodeEndToEndTests.cs","position":null,"original_position":28,"commit_id":"c7ac3572be3615f64083a50b067861e83bb43888","original_commit_id":"c6fc0d0b9de90730e823ba5cb6bfaf219f1d51e0","user":{"login":"fabiocav","id":2507935,"avatar_url":"https://avatars.githubusercontent.com/u/2507935?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiocav","html_url":"https://github.com/fabiocav","followers_url":"https://api.github.com/users/fabiocav/followers","following_url":"https://api.github.com/users/fabiocav/following{/other_user}","gists_url":"https://api.github.com/users/fabiocav/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiocav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiocav/subscriptions","organizations_url":"https://api.github.com/users/fabiocav/orgs","repos_url":"https://api.github.com/users/fabiocav/repos","events_url":"https://api.github.com/users/fabiocav/events{/privacy}","received_events_url":"https://api.github.com/users/fabiocav/received_events","type":"User","site_admin":false},"body":"Argh... Had copied the statement from the code and just changed the property name. That's why I said *something like*. Well, you got the point :)","created_at":"2016-09-10T00:10:42Z","updated_at":"2016-09-10T00:10:42Z","html_url":"https://github.com/Azure/azure-webjobs-sdk-script/pull/664#discussion_r78265673","pull_request_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/664","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/comments/78265673"},"html":{"href":"https://github.com/Azure/azure-webjobs-sdk-script/pull/664#discussion_r78265673"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/664"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/664","id":84718848,"html_url":"https://github.com/Azure/azure-webjobs-sdk-script/pull/664","diff_url":"https://github.com/Azure/azure-webjobs-sdk-script/pull/664.diff","patch_url":"https://github.com/Azure/azure-webjobs-sdk-script/pull/664.patch","issue_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/664","number":664,"state":"open","locked":false,"title":"Workaround for Promise.resolve and process.nextTick edgejs issue","user":{"login":"mamaso","id":9870694,"avatar_url":"https://avatars.githubusercontent.com/u/9870694?v=3","gravatar_id":"","url":"https://api.github.com/users/mamaso","html_url":"https://github.com/mamaso","followers_url":"https://api.github.com/users/mamaso/followers","following_url":"https://api.github.com/users/mamaso/following{/other_user}","gists_url":"https://api.github.com/users/mamaso/gists{/gist_id}","starred_url":"https://api.github.com/users/mamaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mamaso/subscriptions","organizations_url":"https://api.github.com/users/mamaso/orgs","repos_url":"https://api.github.com/users/mamaso/repos","events_url":"https://api.github.com/users/mamaso/events{/privacy}","received_events_url":"https://api.github.com/users/mamaso/received_events","type":"User","site_admin":false},"body":"addresses #223 #241 #596 \r\n\r\n`process.nextTick = global.setImmediate` could break packages which use `nextTick` and it doesn't fix issues with `Promise.resolve(...)`, so I'm removing it.\r\n\r\nA call to `setImmediate` with a dummy function adds an item to the back of the event queue, which unblocks `process.nextTick` and `Promise.resolve(...)`.  I've tested this workaround with YQL, request, Promise, Q, Bluebird, and nextTick, and it unblocks all issues even in nested or chained workflows.  \r\n\r\nI believe that the problems with the event loop are due to edge.js' initialization.  However, it is possible that this hung state can be encountered from some order of an events which I haven't tested, in which case the single `setImmediate` call won't be enough.\r\n\r\nI've filed an issue with edge.js (https://github.com/tjanczuk/edge/issues/485) and I may follow up trying to pinpoint the root cause as I get more time.","created_at":"2016-09-09T21:02:47Z","updated_at":"2016-09-10T00:10:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9952ce30e8a6e2cd48d0302fffef11e49e0d0dc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/664/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/664/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/664/comments","statuses_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/statuses/c7ac3572be3615f64083a50b067861e83bb43888","head":{"label":"mamaso:dev","ref":"dev","sha":"c7ac3572be3615f64083a50b067861e83bb43888","user":{"login":"mamaso","id":9870694,"avatar_url":"https://avatars.githubusercontent.com/u/9870694?v=3","gravatar_id":"","url":"https://api.github.com/users/mamaso","html_url":"https://github.com/mamaso","followers_url":"https://api.github.com/users/mamaso/followers","following_url":"https://api.github.com/users/mamaso/following{/other_user}","gists_url":"https://api.github.com/users/mamaso/gists{/gist_id}","starred_url":"https://api.github.com/users/mamaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mamaso/subscriptions","organizations_url":"https://api.github.com/users/mamaso/orgs","repos_url":"https://api.github.com/users/mamaso/repos","events_url":"https://api.github.com/users/mamaso/events{/privacy}","received_events_url":"https://api.github.com/users/mamaso/received_events","type":"User","site_admin":false},"repo":{"id":67830971,"name":"azure-webjobs-sdk-script","full_name":"mamaso/azure-webjobs-sdk-script","owner":{"login":"mamaso","id":9870694,"avatar_url":"https://avatars.githubusercontent.com/u/9870694?v=3","gravatar_id":"","url":"https://api.github.com/users/mamaso","html_url":"https://github.com/mamaso","followers_url":"https://api.github.com/users/mamaso/followers","following_url":"https://api.github.com/users/mamaso/following{/other_user}","gists_url":"https://api.github.com/users/mamaso/gists{/gist_id}","starred_url":"https://api.github.com/users/mamaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mamaso/subscriptions","organizations_url":"https://api.github.com/users/mamaso/orgs","repos_url":"https://api.github.com/users/mamaso/repos","events_url":"https://api.github.com/users/mamaso/events{/privacy}","received_events_url":"https://api.github.com/users/mamaso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mamaso/azure-webjobs-sdk-script","description":"Scripting the Azure WebJobs SDK","fork":true,"url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script","forks_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/forks","keys_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/teams","hooks_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/hooks","issue_events_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/issues/events{/number}","events_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/events","assignees_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/assignees{/user}","branches_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/branches{/branch}","tags_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/tags","blobs_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/git/refs{/sha}","trees_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/statuses/{sha}","languages_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/languages","stargazers_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/stargazers","contributors_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/contributors","subscribers_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/subscribers","subscription_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/subscription","commits_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/commits{/sha}","git_commits_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/git/commits{/sha}","comments_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/comments{/number}","issue_comment_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/issues/comments{/number}","contents_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/contents/{+path}","compare_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/merges","archive_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/downloads","issues_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/issues{/number}","pulls_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/pulls{/number}","milestones_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/milestones{/number}","notifications_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/labels{/name}","releases_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/releases{/id}","deployments_url":"https://api.github.com/repos/mamaso/azure-webjobs-sdk-script/deployments","created_at":"2016-09-09T20:34:18Z","updated_at":"2016-09-09T20:34:20Z","pushed_at":"2016-09-09T23:41:50Z","git_url":"git://github.com/mamaso/azure-webjobs-sdk-script.git","ssh_url":"git@github.com:mamaso/azure-webjobs-sdk-script.git","clone_url":"https://github.com/mamaso/azure-webjobs-sdk-script.git","svn_url":"https://github.com/mamaso/azure-webjobs-sdk-script","homepage":"","size":15919,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"Azure:dev","ref":"dev","sha":"564d8b42e461876eda33834d6f655f27d9efcb04","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":42548553,"name":"azure-webjobs-sdk-script","full_name":"Azure/azure-webjobs-sdk-script","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-webjobs-sdk-script","description":"Scripting the Azure WebJobs SDK","fork":false,"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script","forks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/forks","keys_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/teams","hooks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/events","assignees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/tags","blobs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/subscription","commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/merges","archive_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/downloads","issues_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/deployments","created_at":"2015-09-15T21:48:19Z","updated_at":"2016-09-06T18:52:56Z","pushed_at":"2016-09-09T23:41:51Z","git_url":"git://github.com/Azure/azure-webjobs-sdk-script.git","ssh_url":"git@github.com:Azure/azure-webjobs-sdk-script.git","clone_url":"https://github.com/Azure/azure-webjobs-sdk-script.git","svn_url":"https://github.com/Azure/azure-webjobs-sdk-script","homepage":"","size":16538,"stargazers_count":120,"watchers_count":120,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":131,"forks":52,"open_issues":131,"watchers":120,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/664"},"html":{"href":"https://github.com/Azure/azure-webjobs-sdk-script/pull/664"},"issue":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/664"},"comments":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/664/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/664/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/pulls/664/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/statuses/c7ac3572be3615f64083a50b067861e83bb43888"}}}}
{"actor":{"display_login":"fabiocav"}}