Repository navigation
Conversation
…ting The buildpacks client starts the function container, sleeps for -start-delay (1 second by default), then sends the first request. On a slow CI runner the server sometimes isn't listening yet, and validation fails with "connection refused" and empty server logs. After the delay, poll localhost:8080 until it accepts a TCP connection, for up to 30 seconds. If it never does, log a warning and continue, so validation still reports the failure and the container logs are still collected.
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.
Summary
The buildpacks client starts the function container, sleeps for
-start-delay(1 second by default, which the reusablebuildpack-integration-test.ymlworkflow also uses), then sends the first request. On a slow runner the server sometimes isn't listening yet, and validation fails with:The server logs are empty, because the framework hasn't started.
This shows up regularly in functions-framework-nodejs: 8 of its last 30
Buildpack Integration Testruns failed this way, across Node 18/20/22 and both thehttpandcloudeventjobs, including scheduled runs onmain.Change
After the existing
-start-delaysleep,run()pollslocalhost:8080until it accepts a TCP connection, for up to 30 seconds.-cmd) path has the same fixed sleep but I haven't seen it flake, so it's left alone.Testing
go test ./client,go vet ./client, andgofmt -son the changed files.