fix blocking node sample test#11843
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Node.js HttpTrigger-Timeout sample function to avoid CPU-bound busy-waiting that can starve the Node event loop and make the NodeProcessCount_RemainsSame_AfterMultipleTimeouts end-to-end test behave unpredictably on constrained CI machines.
Changes:
- Replaced the tight
whileloop (busy wait) with asetTimeout-based delay to avoid blocking the Node event loop. - Ensured the delayed completion path exits early (
return) so the function doesn’t fall through to the synchronouscontext.donecall.
soninaren
approved these changes
Jun 19, 2026
kshyju
approved these changes
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hopefully this really fixes
NodeProcessCount_RemainsSame_AfterMultipleTimeouts. Previous change added more diagnostics and that allowed me to see that this test had some really weird behavior that could really only be chalked up to thread starvation. Logs like this:... a 3 second timeout but the function took exactly 1 minute.
Analysis led me to discover that the node function itself was blocking the thread entirely for 30 seconds with a tight
whileloop (so 2 invocations on one worker -> 60 seconds). It's possible that on these small CI machines the fact that we had 3 node processes blocking their threads was causing all the issues we see with this test.That, at least, is the newest theory. This is a good fix either way and hopefully it removes the issue entirely.
Pull request checklist
IMPORTANT: Currently, changes must be backported to the
in-procbranch to be included in Core Tools and non-Flex deployments.in-procbranch is not requiredrelease_notes.md