timeouts-and-async

timeouts-and-async is a skill for Claude Code from onsi/ginkgo. It costs 106 tokens per session (1,755 once invoked), scanned A, original, MIT.

Guidance for testing asynchronous Go code with Ginkgo and Gomega, two Go testing tools. It covers cancellation, time limits, interrupt handling, and checks that wait for or repeatedly verify conditions.

In plain words
What is it for?
Use it to make Ginkgo tests cancellable, set node or test timeouts, handle Ctrl-C, and test asynchronous behavior with Eventually and Consistently.
Why use it?
It helps tests stop cleanly when they time out or are interrupted and avoids failures being lost when they happen in background goroutines.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the ginkgo plugin — 13 skills shipped together

Good fit Use it to make Ginkgo tests cancellable, set node or test timeouts, handle Ctrl-C, and test asynchronous behavior with Eventually and Consistently.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/onsi/ginkgo/timeouts-and-async
About the project

Ginkgo is a Go testing framework for writing organized, expressive specifications, including unit, integration, and performance tests. Go developers use it with the Gomega matcher library to describe behavior and run test suites.

onsi/ginkgo · 9,051 stars · on GitHub · onsi.github.io

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add onsi/ginkgo --skill timeouts-and-async
Clone the repo
git clone --depth 1 https://github.com/onsi/ginkgo

Made for: Claude Code.

Or install ginkgo, the plugin that ships this one along with the rest of its 13 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for timeouts-and-async

README.md
[![agentmods](https://agentmods.dev/badge/skills/onsi/ginkgo/timeouts-and-async/github.svg)](https://agentmods.dev/skills/onsi/ginkgo/timeouts-and-async)
Your own site
<a href="https://agentmods.dev/skills/onsi/ginkgo/timeouts-and-async"><img src="https://agentmods.dev/badge/skills/onsi/ginkgo/timeouts-and-async/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for timeouts-and-async

Your own site · 80×15
<a href="https://agentmods.dev/skills/onsi/ginkgo/timeouts-and-async"><img src="https://agentmods.dev/badge/skills/onsi/ginkgo/timeouts-and-async.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,755 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00106 $0.01755
Opus 5 $0.00053 $0.00877
Sonnet 5 $0.00021 $0.00351
Haiku 4.5 $0.00011 $0.00176

Measured 9d ago against content hash b33335b757e5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

timeouts-and-async scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ginkgo/skills/timeouts-and-async/SKILL.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Timeouts, interruptible nodes, and async testing

Builds on the failure mental model in ginkgo:overview (failure is a panic Ginkgo recovers; a goroutine that fails needs defer GinkgoRecover()). Docs: https://onsi.github.io/ginkgo/#spec-timeouts-and-interruptible-nodes and https://onsi.github.io/ginkgo/#patterns-for-asynchronous-testing.

Interruptible nodes: take a context, honor cancellation

A setup or subject node becomes interruptible simply by accepting a SpecContext (or plain context.Context) — Ginkgo supplies one automatically:

It("likes to sleep in", func(ctx context.Context) {
  select {
  case <-ctx.Done(): return        // honor cancellation and exit promptly
  case <-time.After(time.Hour): ...
  }
}, NodeTimeout(time.Second))

On timeout or interrupt, Ginkgo cancels the context to tell the node to stop. Pass ctx down into every blocking call (libraryClient.SaveBook(ctx, book), exec.CommandContext(ctx, ...)) so the cancellation actually propagates. Only setup/subject nodes are interruptible — container nodes are not (they run at construction time).

  • ctx.Deadline() does NOT report the node's deadline. Ginkgo manages cancellation timing itself (to snapshot a progress report first), so it does not use a WithDeadline context. Trust <-ctx.Done(), not Deadline().
  • SpecContext satisfies context.Context; you may wrap it (context.WithValue) and Ginkgo still cancels the result on time.

The timeout decorators (full reference → ginkgo:decorators)

Decorator Scope
NodeTimeout(d) Deadline for one interruptible node.
SpecTimeout(d) Deadline for the whole spec lifecycle — It only.
GracePeriod(d) How long Ginkgo waits after cancelling before leaking the node.
  • SpecTimeout can only be more lenient than a node's NodeTimeout — it caps the sum of all nodes (BeforeEach+It+AfterEach); a per-node NodeTimeout inside it is always more stringent.
  • Cleanup still runs after a timeout. When SpecTimeout fires, Ginkgo cancels the current node, then runs AfterEach/AfterAll/DeferCleanup (each under its own NodeTimeout/grace). The timeout is a "mark failed" threshold, not a hard kill.
  • A node that ignores cancellation is "leaked," not killed. After the grace period Ginkgo gives up waiting and moves on. Leaking is deliberately preferred over hanging forever — but a leaked goroutine keeps running and can call Fail/AddReportEntry and pollute a later spec. Always make blocking code respond to ctx.Done().
  • DeferCleanup/DescribeTable entries are interruptible too — give the cleanup/entry func a ctx first arg; don't capture and reuse the parent node's ctx (it's already cancelled by cleanup time).

Read the full file on GitHub · 99 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 99 lines · 106 tokens per session scan A b33335b757e5

Subscribe to this mod's changes

timeouts-and-async is a skill published in the GitHub repository onsi/ginkgo (9,051 stars, last pushed 29d ago), licensed MIT. It adds 106 tokens to every session and 1,755 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

Codeception Testing

Expert-level Codeception testing skill for PHP applications. Covers acceptance, functional, and unit testing with the Actor pattern, BDD-style syntax, Page Objects, API testing, and database helpers.

PramodDutta/qaskills · 42 tokens

Jasmine Testing

BDD-style JavaScript testing with Jasmine covering spies, async patterns, custom matchers, clock manipulation, and comprehensive test organization for frontend and Node.js applications.

PramodDutta/qaskills · 35 tokens

rust-testing

Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage. Follows TDD methodology.

affaan-m/ECC · 31 tokens

golang-testing

Go testing best practices including table-driven tests, test helpers, benchmarking, race detection, coverage analysis, and integration testing patterns. Use when writing or improving Go tests.

affaan-m/ECC · 37 tokens

temporal-python-testing

Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.

wshobson/agents · 45 tokens

migrate-xunit-to-xunit-v3

Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…

dotnet/skills · 149 tokens