test(examples): retry background sidecar on transient port-bind flake#1101
Open
kshitizj03 wants to merge 1 commit into
Open
test(examples): retry background sidecar on transient port-bind flake#1101kshitizj03 wants to merge 1 commit into
kshitizj03 wants to merge 1 commit into
Conversation
`test_demo_actor` flakes when the demo-actor sidecar, started via `DaprRunner.start()`, loses a random-port race at boot: daprd assigns the same port to its API and internal gRPC servers, the internal listener fails with "bind: address already in use", and the runtime exits with "could not listen on any endpoint". The actor host is then dead, so the client's `invoke_method` fails with "did not find address for actor" and the expected output never appears. PR dapr#1030 already added this retry to the foreground `run()` path, but the background `start()` path was left uncovered. Apply the same exponential backoff retry there, reusing the existing failure markers. The captured log is only read once the process has exited (`poll()` is not None), so a healthy long-lived sidecar is never inspected and its append offset is left untouched. Adds unit tests mirroring the existing `run()` coverage. Fixes dapr#1061 Signed-off-by: Kshitiz Jain <kshitizj@gmail.com>
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.
Description
test_demo_actorflakes when the demo-actor sidecar, started viaDaprRunner.start(), loses a random-port race at boot: daprd assigns the same port to its API and internal gRPC servers, the internal listener fails with "bind: address already in use", and the runtime exits with "could not listen on any endpoint". The actor host is then dead, so the client'sinvoke_methodfails with "did not find address for actor" and the expected output never appears.PR #1030 already added this retry to the foreground
run()path, but the backgroundstart()path was left uncovered. This applies the same exponential backoff retry there, reusing the existing failure markers. The captured log is only read once the process has exited (poll()is not None), so a healthy long-lived sidecar is never inspected and its append offset is left untouched.Adds unit tests mirroring the existing
run()coverage.Fixes #1061
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: