Skip to content

fix: create tempdir prior to cleanup #11394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: create tempdir prior to cleanup
See https://github.com/coder/coder/actions/runs/7399827933/job/20132407700

Seems like this happened because the test was being cleaned up
while the tempdir was being made.
  • Loading branch information
kylecarbs committed Jan 3, 2024
commit 10638387e2f16b86e83f36be5de7e92300627fca
3 changes: 2 additions & 1 deletion provisionerd/provisionerd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1137,12 +1137,13 @@ func createProvisionerClient(t *testing.T, done <-chan struct{}, server provisio
})
ctx, cancelFunc := context.WithCancel(context.Background())
closed := make(chan struct{})
tempDir := t.TempDir()
go func() {
defer close(closed)
_ = provisionersdk.Serve(ctx, &server, &provisionersdk.ServeOptions{
Listener: serverPipe,
Logger: slogtest.Make(t, nil).Leveled(slog.LevelDebug).Named("test-provisioner"),
WorkDirectory: t.TempDir(),
WorkDirectory: tempDir,
})
}()
t.Cleanup(func() {
Expand Down