-
Notifications
You must be signed in to change notification settings - Fork 39
fix: implement more robust retries for Watch #535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
07c540b to
e3696bb
Compare
481580d to
979db72
Compare
979db72 to
abab714
Compare
tstirrat15
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments, otherwise LGTM
internal/commands/watch_test.go
Outdated
| }() | ||
| t.Cleanup(s.Stop) | ||
|
|
||
| conn, err := grpc.NewClient("passthrough://bufnet", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
a440855 to
69f8f1e
Compare
69f8f1e to
7be8cfd
Compare
tstirrat15
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, LGTM
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