Skip to content

Commit

Permalink
improvement: add better error handling when failing to archive test a…
Browse files Browse the repository at this point in the history
…rtifacts (#6802)

* improvement: add better error handling when failing to archive test artifacts

Co-authored-by: Steffen Neubauer <steffen@garden.io>

* improvement: increase timeout for archiving test artifacts to 10 minutes

* chore: update comment

* fix: better error handling

---------

Co-authored-by: Steffen Neubauer <steffen@garden.io>
  • Loading branch information
10ko and stefreak authored Jan 24, 2025
1 parent 72263fe commit 589cb39
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions core/src/plugins/kubernetes/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -582,29 +582,22 @@ async function runWithArtifacts({
log,
stdout,
stderr,
// Anything above two minutes for this would be unusual
timeoutSec: 120,
// Anything above 10 minutes for this would be unusual
timeoutSec: 600,
buffer: true,
})
} catch (err) {
// TODO: fall back to copying `arc` (https://github.com/mholt/archiver) or similar into the container and
// using that (tar is not statically compiled so we can't copy that directly). Keeping this snippet around
// for that:
// await runner.exec({
// command: ["/bin/sh", "-c", `mkdir -p /.garden/bin/ && sed -n 'w /.garden/bin/arc' && chmod +x /.garden/bin/arc`],
// container: containerName,
// ignoreError: false,
// input: <binary>,
// log,
// stdout,
// stderr,
// })
throw new ConfigurationError({
message: deline`
if (err instanceof PodRunnerWorkloadError && err.details.exitCode === 127) {
throw new ConfigurationError({
message: deline`
${description} specifies artifacts to export, but the image doesn't
contain the tar binary. In order to copy artifacts out of Kubernetes containers, both sh and tar need to
be installed in the image.`,
})
wrappedErrors: [err],
})
} else {
throw err
}
}

try {
Expand Down

0 comments on commit 589cb39

Please sign in to comment.