Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
cockroachdb avatar

Skip Test With Issue

  • 4 installs
  • 32.4k repo stars
  • Updated July 30, 2026
  • cockroachdb/cockroach

Skips a flaky or broken Go test using skip.WithIssue with a tracking issue number, placed after the defer statements.

About

Adds a skip.WithIssue call (or a conditional variant like UnderRace) to disable a flaky Go test with issue tracking. A developer uses it to skip a broken CockroachDB test while linking a GitHub issue.

  • skip.WithIssue plus UnderRace/UnderDeadlock/UnderDuress variants
  • Placed after defer statements with a specific reason

Skip Test With Issue by the numbers

  • 4 all-time installs (skills.sh)
  • Ranked #1,631 of 2,153 Testing & QA skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cockroachdb/cockroach --skill skip-test-with-issue

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs4
repo stars32.4k
Last updatedJuly 30, 2026
Repositorycockroachdb/cockroach

What it does

Skips a flaky or broken Go test using skip.WithIssue with a tracking issue number, placed after the defer statements.

Files

SKILL.mdMarkdownGitHub ↗

Skip a Flaky Test

Use skip.WithIssue from "github.com/cockroachdb/cockroach/pkg/testutils/skip" to skip a test with a tracking issue number.

Usage

Ask the user for the GitHub issue number, then add the skip after the defer statements:

func TestFlakyTest(t *testing.T) {
    defer leaktest.AfterTest(t)()
    defer log.Scope(t).Close(t)
    skip.WithIssue(t, 167182, "flaky due to timeout")

    // test body...
}

Other Common Skip Variants

The skip package provides several other incantations for conditional skips:

  • skip.UnderRace(t, issueNum, "reason") - skip only when running with race detector
  • skip.UnderDeadlock(t, issueNum, "reason") - skip only when running with deadlock detector
  • skip.UnderDuress(t, issueNum, "reason") - skip only when running under stress/duress

Use these when a test is flaky only under specific conditions rather than universally broken.

Notes

  • Issue number is an integer, not a string
  • Place skip call after defer statements, before test body
  • Be specific in reason: "flaky due to timeout" not just "flaky"
  • Multiple tests with same root cause can share an issue number
  • Ensure the skip package is imported
  • Run crlfmt -w -tab 2 <file> after editing

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.