skip-test-with-issue

Skip flaky Go tests with tracked GitHub issue numbers using the skip package.

32.4k|4.1k|Updated Feb 6, 2014
One-click install
npx skills add https://github.com/cockroachdb/cockroach --skill skip-test-with-issue
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: skip-test-with-issue
Source: https://github.com/cockroachdb/cockroach/tree/main/.claude/skills/skip-test-with-issue
Command: npx skills add https://github.com/cockroachdb/cockroach --skill skip-test-with-issue

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Flaky or broken tests block CI pipelines and waste developer time, but skipping them without tracking leads to forgotten technical debt. This Skill ensures every skipped test in the CockroachDB codebase is properly annotated with a GitHub issue number and a clear reason.

Core Features & Use Cases

  • Issue-Tracked Skips: Adds skip.WithIssue(t, issueNum, reason) calls to Go tests so every skip links to a tracking issue.
  • Conditional Skip Variants: Supports skip.UnderRace, skip.UnderDeadlock, and skip.UnderDuress for tests that only fail under specific build conditions.
  • Use Case: A test times out intermittently under the race detector. Instead of deleting it, add skip.UnderRace(t, 167182, "flaky due to timeout") so CI stays green while the issue is investigated.

Quick Start

Ask the assistant to skip the flaky test TestMyFeature with GitHub issue 167182 and a reason describing the failure.

Frequently Asked Questions about skip-test-with-issue

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

FAQPage Schema
How do I skip a flaky test in Go with issue tracking?

Use skip.WithIssue from the CockroachDB testutils/skip package, passing the testing object, an integer GitHub issue number, and a reason string. Place the call after defer statements and before the test body.

How to skip a Go test only under the race detector?

Use skip.UnderRace(t, issueNum, reason) to skip a test only when running with the race detector enabled. Similar variants exist for deadlock detection and stress conditions via skip.UnderDeadlock and skip.UnderDuress.

Where should the skip call be placed in a Go test?

Place the skip call after defer statements such as leaktest.AfterTest and log.Scope, but before the test body. This ensures cleanup defers are registered before the test exits via the skip.

Can multiple flaky tests share the same GitHub issue number?

Yes, multiple tests with the same root cause can share one issue number. This consolidates tracking so fixing the underlying issue re-enables all related tests at once.

What format should the skip reason follow?

The reason should be specific about the failure mode, such as "flaky due to timeout", rather than a generic word like "flaky". The issue number must be an integer, not a string.