Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions frontend/dockerfile/dockerfile_addgit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,6 @@ func testGitQueryString(t *testing.T, sb integration.Sandbox) {
f := getFrontend(t, sb)

subModDir := t.TempDir()
defer os.RemoveAll(subModDir)
Copy link
Member Author

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.


err := runShell(subModDir, []string{
"git init",
"git config --local user.email test",
Expand All @@ -375,7 +373,6 @@ func testGitQueryString(t *testing.T, sb integration.Sandbox) {
submodServerURL := subModServer.URL

gitDir := t.TempDir()
defer os.RemoveAll(gitDir)
err = runShell(gitDir, []string{
"git init",
"git config --local user.email test",
Expand Down Expand Up @@ -640,11 +637,7 @@ COPY foo out
})
}

cl, err := client.New(sb.Context(), sb.Address())
require.NoError(t, err)
defer c.Close()
Comment on lines -643 to -645
Copy link
Member

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 ?

buildkit/client/client.go

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 {

Copy link
Member Author

@crazy-max crazy-max Sep 1, 2025

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, gotcha; thanks!


err = cl.Prune(sb.Context(), nil)
err = c.Prune(sb.Context(), nil)
require.NoError(t, err)

for _, tc := range tcases {
Expand Down