Skip to content

Conversation

@meln5674
Copy link
Contributor

@meln5674 meln5674 commented Aug 4, 2025

In some situations, cleanup of an otherwise successful test suite fails with the error

[FAILED] DeferCleanup callback returned error: unlinkat /tmp/ginkgo$RANDOMID/Default: directory not empty

reported to be at

$GOPATH/pkg/mod/github.com/onsi/ginkgo/v2@v2.14.0/internal/testingtproxy/testing_t_proxy.go:153

As best I can tell, this is a result of the spawned chrome instance writing a temporary file after ginkgo attempts to run a DeferCleanup-ed os.Remove on its directory as a result of a race condition.

This patch, at least empirically, fixes this by calling chromedp.Cancel which, according to its docstring, ensures chrome is cleaned up before returning.

As a test, a test suite which would previously fail with this error at a rate of about 1 in 10 was run with --until-it-fails for 10 minutes without error. Removing this line and running again resulted in a failure within a minute.

@onsi onsi merged commit 8a7d246 into onsi:master Aug 7, 2025
1 of 3 checks passed
@onsi
Copy link
Owner

onsi commented Aug 7, 2025

sweet, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants