deps: update buildkit, vendor changes

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
This commit is contained in:
Laura Brehm
2023-12-19 12:36:24 +00:00
parent 8484fcdd57
commit 0f45b629ad
157 changed files with 17189 additions and 1232 deletions

View File

@ -67,8 +67,9 @@ http:
}
deferF.Append(stop)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
ctx, cancel := context.WithCancelCause(context.Background())
ctx, _ = context.WithTimeoutCause(ctx, 5*time.Second, errors.WithStack(context.DeadlineExceeded))
defer cancel(errors.WithStack(context.Canceled))
url, err = detectPort(ctx, rc)
if err != nil {
return "", nil, err

View File

@ -423,3 +423,10 @@ func prepareValueMatrix(tc testConf) []matrixValue {
}
return m
}
// Skips tests on Windows
func SkipOnPlatform(t *testing.T, goos string) {
if runtime.GOOS == goos {
t.Skipf("Skipped on %s", goos)
}
}

View File

@ -99,7 +99,7 @@ func newSandbox(ctx context.Context, w Worker, mirror string, mv matrixValue) (s
b, closer, err := w.New(ctx, cfg)
if err != nil {
return nil, nil, err
return nil, nil, errors.Wrap(err, "creating worker")
}
deferF.Append(closer)

View File

@ -5,7 +5,6 @@ import (
"context"
"fmt"
"io"
"net"
"os"
"os/exec"
"strings"
@ -100,13 +99,11 @@ func StartCmd(cmd *exec.Cmd, logs map[string]*bytes.Buffer) (func() error, error
}, nil
}
func WaitUnix(address string, d time.Duration, cmd *exec.Cmd) error {
address = strings.TrimPrefix(address, "unix://")
addr, err := net.ResolveUnixAddr("unix", address)
if err != nil {
return errors.Wrapf(err, "failed resolving unix addr: %s", address)
}
// WaitSocket will dial a socket opened by a command passed in as cmd.
// On Linux this socket is typically a Unix socket,
// while on Windows this will be a named pipe.
func WaitSocket(address string, d time.Duration, cmd *exec.Cmd) error {
address = strings.TrimPrefix(address, socketScheme)
step := 50 * time.Millisecond
i := 0
for {
@ -114,7 +111,7 @@ func WaitUnix(address string, d time.Duration, cmd *exec.Cmd) error {
return errors.Errorf("process exited: %s", cmd.String())
}
if conn, err := net.DialUnix("unix", nil, addr); err == nil {
if conn, err := dialPipe(address); err == nil {
conn.Close()
break
}

View File

@ -0,0 +1,23 @@
//go:build !windows
// +build !windows
package integration
import (
"net"
"github.com/pkg/errors"
)
var socketScheme = "unix://"
// abstracted function to handle pipe dialing on unix.
// some simplification has been made to discard
// laddr for unix -- left as nil.
func dialPipe(address string) (net.Conn, error) {
addr, err := net.ResolveUnixAddr("unix", address)
if err != nil {
return nil, errors.Wrapf(err, "failed resolving unix addr: %s", address)
}
return net.DialUnix("unix", nil, addr)
}

View File

@ -0,0 +1,15 @@
package integration
import (
"net"
"github.com/Microsoft/go-winio"
)
var socketScheme = "npipe://"
// abstracted function to handle pipe dialing on windows.
// some simplification has been made to discard timeout param.
func dialPipe(address string) (net.Conn, error) {
return winio.DialPipe(address, nil)
}