-
Notifications
You must be signed in to change notification settings - Fork 1.3k
dockerfile: fix client init in testGitQueryString #6179
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
Signed-off-by: CrazyMax <[email protected]>
| f := getFrontend(t, sb) | ||
|
|
||
| subModDir := t.TempDir() | ||
| defer os.RemoveAll(subModDir) |
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 not needed, t.TempDir() is removed when test is completed.
| cl, err := client.New(sb.Context(), sb.Address()) | ||
| require.NoError(t, err) | ||
| defer c.Close() |
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 was the actual fix, correct? I was trying to find where the deadlock was, but I guess somewhere in the client.New constructor?
Or is it related to the grpc.DialContext ?
Lines 154 to 157 in 9fcedf9
| // ignore SA1019 NewClient has different behavior and needs to be tested | |
| //nolint:staticcheck | |
| conn, err := grpc.DialContext(ctx, address, gopts...) | |
| if err != nil { |
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.
Actual fix is cl is not closed so on line 645 defer cl.Close() would work but then cl.Prune later would be useless so we need to reuse the same client.
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, gotcha; thanks!
thaJeztah
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.
LGTM
relates to moby/moby#50858