/tmp/consul-test folder is not deleted when test finishes
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 39
Description
#### Overview of the Issue
When running a Consul CLI, it starts TestServer(s) to run test(s).
At https://github.com/hashicorp/consul/blob/master/sdk/testutil/io.go#L26, /tmp/consul-test folder is created as the base directory for all temporary directories and files created with TempDir and TempFile.
However /tmp/consul-test folder won't be deleted when the test finishes.
Can we delete this folder when test is done? Or can we have a flag in Consul CLI to disable test?
#### Reproduction Steps
Steps to reproduce this issue, eg:
1. Download and install Consul binary in Windows.
2. In cmd.exe, run `consul`
3. Check c:\tmp, there is a consul-test folder.

### Consul info for both Client and Server
Client info
```
output from client 'consul info' command here
```
Server info
```
output from server 'consul info' command here
```
### Operating system and Environment details
Windows 10 & Windows 2019, consul v1.7.3 & v1.9.5
### Log Fragments
No log
Contributor guide
Research direction
Start with sdk/testutil/io.go, especially the code that creates /tmp/consul-test and the TempDir or TempFile cleanup paths. Reproduce the behavior on Windows with the Consul CLI, then run the affected testutil tests. Done means the base temporary folder is removed when test execution finishes, including the reported Windows case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100