tidb-realtikv-runner

Runs TiDB realtikvtest suites against a local TiUP playground with readiness checks and cleanup.

40.5k|6.2k|Updated Sep 6, 2015
One-click install
npx skills add https://github.com/pingcap/tidb --skill tidb-realtikv-runner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tidb-realtikv-runner
Source: https://github.com/pingcap/tidb/tree/main/.agents/skills/tidb-realtikv-runner
Command: npx skills add https://github.com/pingcap/tidb --skill tidb-realtikv-runner

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Running TiDB integration tests under tests/realtikvtest requires a correctly started local TiUP playground, readiness verification, scoped test execution, and reliable teardown, which is error-prone when done manually.

Core Features & Use Cases

  • Playground Lifecycle Management: Starts the TiUP playground in the background, verifies readiness via the PD endpoint, and cleans up processes and data afterward.
  • Scoped Test Execution: Keeps test runs narrow using -run flags and target subdirectories to avoid unnecessary work.
  • Failpoint Handling: Enables failpoints before tests and disables them afterward when tests require them.
  • Use Case: A TiDB contributor modifying DDL code runs only the relevant realtikvtest package against a local playground, then confirms the PD endpoint is unreachable after cleanup.

Quick Start

Run the realtikvtest suite for my target package using the TiUP playground workflow, then verify cleanup by confirming the PD endpoint is down.

Frequently Asked Questions about tidb-realtikv-runner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run TiDB realtikvtest tests locally?

Start a TiUP playground in the background, verify readiness on the PD endpoint at 127.0.0.1:2379, then run the target test with a narrow -run flag against the specific tests/realtikvtest subdirectory. Clean up the playground process and data afterward.

How do I handle PD port conflicts when running TiDB tests?

The default PD address is 127.0.0.1:2379. If a port conflict occurs, start the playground with --pd.port or --port-offset to select alternate ports, then point the tests at the new PD address.

How do I use failpoints in TiDB integration tests?

Enable the required failpoints before running the tests and disable them afterward. This ensures failpoint state does not leak into subsequent test runs or the shared playground environment.

How do I verify TiUP playground cleanup after tests?

Confirm teardown by checking that the PD endpoint is unreachable after stopping the playground. If the endpoint still responds, the playground process or its data has not been fully cleaned up.

When should I not use the realtikvtest playground workflow?

Avoid it for unit tests that do not need a real TiKV cluster, since starting a full playground adds startup and teardown overhead. Use it only for tests under tests/realtikvtest that require a live PD and TiKV environment.