pd-ut test runs can become flaky due to leaked temporary files
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 783
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 36
Description
## Flaky Test
### Which jobs are failing
PD unit test jobs that run through `pd-ut` can be affected. Accumulated temporary files can contaminate later runs or exhaust temporary storage, making failures depend on previous test executions.
### CI link
Not tied to a single CI failure. The resource leak was identified while investigating temporary artifacts left by `pd-ut`.
Related fix: #11224
### Reason for failure (if possible)
`pd-ut` does not consistently release the temporary resources it owns:
- `buildTestBinaryMulti` creates a `pd_tests*` temporary file without removing it.
- Coverage runs create a `cov*` temporary directory, but error paths call `os.Exit`, bypassing deferred cleanup.
- As a result, temporary artifacts may remain after both successful and failed test runs.
### Anything else
Cleanup should be handled by the code that allocates these resources instead of wrapping test commands in Makefile scripts.
Contributor guide
Research direction
Start by locating the pd-ut entry points for buildTestBinaryMulti and coverage runs, then inspect how each allocated temporary resource is handled on success and error paths. Check the related fix in issue #11224 and any Makefile wrappers mentioned. Done means pd_tests* files and cov* directories are cleaned up by the allocating code after successful and failed runs, without relying on Makefile cleanup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- testing, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100