pingcap / pingcap/tidb

Introducing the -test.short parameter for skipping long-running tests

Open
#45,386 4 comments 3 reactions 0 assignees View on GitHub
type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement

We have introduced a new parameter for our Go tests: [-test.short](https://pkg.go.dev/testing#Short). This parameter allows developers to skip long-running tests, which can save a significant amount of time during development and testing.

Long-running tests can be a bottleneck in the development process, especially when running complete test suites. With the -test.short parameter, developers can quickly run tests and get feedback on their code without waiting for long-running tests to complete.
We recommend using this parameter during development and testing, as it can significantly speed up the testing process. However, please note that this parameter may skip some important tests, so it should not be used in production environments.

To use the -test.short parameter, simply add it to the command line when running tests. For example, "go test -test.short" will skip long-running tests.

We encourage all developers to start using this parameter in their testing process to improve efficiency and reduce development time.

# How to define short tests?

If a test meets the following conditions, we consider it a short test:
- It is not a flaky test.
- It can be completed within 5 seconds, regardless of whether race is enabled or not.

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.