exec: improve error message on exec errors

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
v0.9
Tonis Tiigi 2021-06-30 20:18:35 -07:00
parent 460ba750fd
commit a27d7c3d81
3 changed files with 4 additions and 4 deletions

View File

@ -677,7 +677,7 @@ func testSecurityModeSysfs(t *testing.T, sb integration.Sandbox) {
if secMode == securitySandbox {
require.Error(t, err)
require.Contains(t, err.Error(), "executor failed running")
require.Contains(t, err.Error(), "did not complete successfully")
require.Contains(t, err.Error(), "mkdir /sys/fs/cgroup/cpuset/securitytest")
} else {
require.NoError(t, err)
@ -3190,7 +3190,7 @@ func testReadonlyRootFS(t *testing.T, sb integration.Sandbox) {
// Would prefer to detect more specifically "Read-only file
// system" but that isn't exposed here (it is on the stdio
// which we don't see).
require.Contains(t, err.Error(), "executor failed running [/bin/touch /foo]:")
require.Contains(t, err.Error(), "process \"/bin/touch /foo\" did not complete successfully")
checkAllReleasable(t, c, sb, true)
}

View File

@ -2149,7 +2149,7 @@ func testDockerfileInvalidCommand(t *testing.T, sb integration.Sandbox) {
err = cmd.Run()
require.Error(t, err)
require.Contains(t, stdout.String(), "/bin/sh -c invalidcmd")
require.Contains(t, stdout.String(), "executor failed running")
require.Contains(t, stdout.String(), "did not complete successfully")
}
func testDockerfileADDFromURL(t *testing.T, sb integration.Sandbox) {

View File

@ -354,7 +354,7 @@ func (e *execOp) Exec(ctx context.Context, g session.Group, inputs []solver.Resu
// Prevent the result from being released.
p.OutputRefs[i].Ref = nil
}
return results, errors.Wrapf(execErr, "executor failed running %v", e.op.Meta.Args)
return results, errors.Wrapf(execErr, "process %q did not complete successfully", strings.Join(e.op.Meta.Args, " "))
}
func proxyEnvList(p *pb.ProxyEnv) []string {