Skip to main content

skip-test-with-issue

Skip a flaky or broken test with proper issue tracking. Use when asked to skip a test, disable a test, or mark a test as flaky.

Informações da origem

Repositório
cockroachdb/cockroach
Última atividade na origem
6 de abril de 2026 às 17:58
Idioma detectado do SKILL.md
inglês
Estrelas
32.570
Forks
4.131

Opções de instalação

Por padrão, está selecionado o prompt que primeiro revisa a origem. Você pode mudar para um comando direto ou baixar uma cópia local.

Revise os arquivos de origem

Leia o SKILL.md e os arquivos complementares exibidos pelo SkillsMP antes de decidir se vai instalar.

Exibindo SKILL.md

SKILL.md
Instruções da origem · Visualização somente leitura
name
skip-test-with-issue
description
Skip a flaky or broken test with proper issue tracking. Use when asked to skip a test, disable a test, or mark a test as flaky.
# 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: ```go 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
Ver no GitHub