Skip to content

fix: isolate updater service test files#1644

Open
immanuwell wants to merge 1 commit intocloudflare:masterfrom
immanuwell:fix-updater-test-temp-path
Open

fix: isolate updater service test files#1644
immanuwell wants to merge 1 commit intocloudflare:masterfrom
immanuwell:fix-updater-test-temp-path

Conversation

@immanuwell
Copy link
Copy Markdown

@immanuwell immanuwell commented May 10, 2026

What

Updater service tests used filepath.Join(os.TempDir(), "test") as a shared fake binary path. If /tmp/test already exists as a dir, the package falls over before it tests updater logic. tiny papercut, but pretty easy to hit on a dev box.

This swaps it to t.TempDir() so each test gets its own scratch file. No prod code touched.

Repro

mkdir -p /tmp/test
go test ./cmd/cloudflared/updater

Before: open /tmp/test: is a directory

After: updater tests pass.

Tested

go test ./cmd/cloudflared/updater
go test -race -mod=vendor ./cmd/cloudflared/updater
go test ./...

go test ./... still hits local ingress ICMP permission failures here, unrelated to this change.

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.

1 participant