fix: implement more robust retries for Watch - #535
Merged
Conversation
miparnisari
force-pushed
the
retry-watch
branch
2 times, most recently
from
August 26, 2025 23:56
07c540b to
e3696bb
Compare
miparnisari
force-pushed
the
retry-watch
branch
5 times, most recently
from
September 10, 2025 02:26
481580d to
979db72
Compare
miparnisari
force-pushed
the
retry-watch
branch
from
September 11, 2025 03:21
979db72 to
abab714
Compare
miparnisari
marked this pull request as ready for review
September 11, 2025 03:23
tstirrat15
reviewed
Sep 11, 2025
tstirrat15
left a comment
Contributor
There was a problem hiding this comment.
See comments, otherwise LGTM
| }() | ||
| t.Cleanup(s.Stop) | ||
|
|
||
| conn, err := grpc.NewClient("passthrough://bufnet", |
Contributor
Author
There was a problem hiding this comment.
This is establishing a connection to my custom-made Watch server.
I see that other tests do it differently:
// Set up client
ctx := t.Context()
srv := zedtesting.NewTestServer(ctx, t)
go func() {
require.NoError(srv.Run(ctx))
}()
conn, err := srv.GRPCDialContext(ctx)
require.NoError(err)
originalClient := client.NewClient
defer func() {
client.NewClient = originalClient
}()
client.NewClient = zedtesting.ClientFromConn(conn)
c, err := zedtesting.ClientFromConn(conn)(cmd)
require.NoError(err)but in my case i don't want to rely on a real SpiceDB server; I want to have full control on the response given by Watch
Contributor
There was a problem hiding this comment.
Ah yeah in the tests that I was working on I used a fake client and then supplied responses directly through it. Is there a reason to prefer one approach to the other in this case?
miparnisari
force-pushed
the
retry-watch
branch
2 times, most recently
from
September 11, 2025 20:21
a440855 to
69f8f1e
Compare
miparnisari
force-pushed
the
retry-watch
branch
from
September 12, 2025 16:54
69f8f1e to
7be8cfd
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Similar to authzed/authzed-java#137, I'm modifying the implementation of the
zed relationships watchcommand so thatTesting
Locally against a locally running instance that is behind a Contour/Envoy reverse proxy.
before
with this PR
References