pingcap / pingcap/tidb

Flaky unit tests: stabilize task register, TLS, and memory limit tuner

Open
#65,673 2 comments 0 reactions 0 assignees View on GitHub
component/br severity/minor type/bug type/bugfix
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

### Summary
Some unit tests are flaky due to timing assumptions and shared global state.

### Symptoms
- `br/pkg/utils`: `TestTaskRegisterFailedGrant` / `TestTaskRegisterFailedReput` rely on fixed sleeps while etcd lease keepalive/retry is asynchronous.
- `pkg/util/gctuner`: `TestIssue48741` assumes `debug.SetMemoryLimit` updates are immediate.
- `pkg/util`: `TestVerifyCommonNameAndRotate` depends on unstable client-side TLS error strings and uses the global `http.DefaultServeMux`.

### Expected
Make these tests stable without changing production behavior.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.