From 2994dfa964f875482704a91e1fe91a89ef3d7482 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 11 Aug 2025 15:07:43 +0200 Subject: [PATCH] chore(tests): differentiate 'failed to copy content' errors 2025-08-11T13:02:51.0737198Z --- FAIL: TestRunner_RunEvent (431.14s) 2025-08-11T13:02:51.0737236Z --- FAIL: TestRunner_RunEvent/evalmatrix (2.69s) 2025-08-11T13:02:51.0737270Z runner_test.go:211: 2025-08-11T13:02:51.0737303Z Error Trace: /home/debian/.cache/act/1682da88a8a84081/hostexecutor/act/runner/runner_test.go:211 2025-08-11T13:02:51.0737398Z /home/debian/.cache/act/1682da88a8a84081/hostexecutor/act/runner/runner_test.go:362 2025-08-11T13:02:51.0737436Z Error: Received unexpected error: 2025-08-11T13:02:51.0737470Z failed to copy content to container: Error response from daemon: Could not find the file /var/run/act/ in container ab61dffc6010bc922c0ab2d2c7edb7a7fe066258ce0145d4146771ce6afbc8f9 2025-08-11T13:02:51.0737507Z Test: TestRunner_RunEvent/evalmatrix 2025-08-11T13:02:51.0737551Z Messages: /home/debian/.cache/act/1682da88a8a84081/hostexecutor/act/runner/testdata/evalmatrix In the absence of a stack trace, having three different places in the sources where the same error message shows does not help to figure out how it can happen. This is a daily false negative. --- act/container/docker_run.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/act/container/docker_run.go b/act/container/docker_run.go index ac52cee5..b64703c0 100644 --- a/act/container/docker_run.go +++ b/act/container/docker_run.go @@ -835,7 +835,7 @@ func (cr *containerReference) CopyTarStream(ctx context.Context, destPath string // Copy Content err = cr.cli.CopyToContainer(ctx, cr.id, destPath, tarStream, container.CopyToContainerOptions{}) if err != nil { - return fmt.Errorf("failed to copy content to container: %w", err) + return fmt.Errorf("copyTarStream: failed to copy content to container: %w", err) } // If this fails, then folders have wrong permissions on non root container if cr.UID != 0 || cr.GID != 0 { @@ -911,7 +911,7 @@ func (cr *containerReference) copyDir(dstPath, srcPath string, useGitIgnore bool } err = cr.cli.CopyToContainer(ctx, cr.id, "/", tarFile, container.CopyToContainerOptions{}) if err != nil { - return fmt.Errorf("failed to copy content to container: %w", err) + return fmt.Errorf("copyDir: failed to copy content to container: %w", err) } return nil } @@ -945,7 +945,7 @@ func (cr *containerReference) copyContent(dstPath string, files ...*FileEntry) c logger.Debugf("Extracting content to '%s'", dstPath) err := cr.cli.CopyToContainer(ctx, cr.id, dstPath, &buf, container.CopyToContainerOptions{}) if err != nil { - return fmt.Errorf("failed to copy content to container: %w", err) + return fmt.Errorf("copyContent: failed to copy content to container: %w", err) } return nil }