condition-based-waiting
Stabilize Async Tests with Condition Waiting
Flaky tests often fail because they guess how long async work takes. This skill shows Claude, Codex, and Claude Code how to wait for real conditions instead of fixed delays.
Stop for confirmation before installing.
Review the plan and obtain explicit user consent before changing files.
Install with my Agent
Copy this request to your Agent. It includes the canonical Skill page and manifest.
Review the Skillstore skill "condition-based-waiting" from https://skillstore.io/skills/dyai2025-condition-based-waiting.md and its manifest at https://skillstore.io/api/skills/dyai2025-condition-based-waiting/manifest. Verify the artifact. Stop and obtain explicit user consent before installing or changing files.Your Agent should still show its plan and request any confirmation required by the security policy.
Agent-readable resources
Use these links when an AI agent, crawler, or script needs clean context instead of reading the full page.
Test it
Using "condition-based-waiting". A test waits 300 milliseconds before checking whether two tool calls started.
Expected outcome:
The skill would recommend waiting until two matching tool call events are observed, then asserting on the result.
Using "condition-based-waiting". A test checks a result after a short delay and sometimes fails in CI.
Expected outcome:
The skill would suggest polling for the result to become available with a timeout and a descriptive failure message.
Using "condition-based-waiting". A debounce test waits for a documented interval before asserting behavior.
Expected outcome:
The skill would keep the timed wait if the delay is part of the behavior under test and the reason is documented.
Security Audit
SafeThe apparent external command findings are false positives caused by Markdown backticks and TypeScript template literals in examples. No prompt injection, data exfiltration, or malicious execution intent was found in the reviewed text files, but the bundled SKILL.zip remains an unscanned artifact that should be reviewed before publication.
Risk Factors
โ๏ธ External commands (19)
๐ Filesystem access (1)
Share & cite this report
Share the versioned assessment report, neutral badge, embed card, and citations. Skillstore reports evidence without deciding whether this Skill is safe.
Copy report link
https://skillstore.io/skills/dyai2025-condition-based-waiting/audits/10?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown badge
[](https://skillstore.io/skills/dyai2025-condition-based-waiting?utm_source=security_passport_badge)HTML badge
<a href="https://skillstore.io/skills/dyai2025-condition-based-waiting?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/dyai2025-condition-based-waiting/security.svg" alt="Skillstore security assessment" loading="lazy"></a>Embed card
<iframe src="https://skillstore.io/embed/skills/dyai2025-condition-based-waiting.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>Academic citations (APA ยท BibTeX ยท CFF)
APA citation
DYAI2025. (2026). condition-based-waiting security audit report (audit version 10) [Author version unspecified]. Skillstore. https://skillstore.io/skills/dyai2025-condition-based-waiting/audits/10BibTeX citation
@techreport{dyai2025-dyai2025-condition-based-waiting-2026,
author = {DYAI2025},
title = {condition-based-waiting security audit report (audit version 10)},
institution = {Skillstore},
year = {2026},
number = {10},
url = {https://skillstore.io/skills/dyai2025-condition-based-waiting/audits/10},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "condition-based-waiting security audit report (audit version 10)"
version: "unspecified"
type: report
authors:
- name: "DYAI2025"
date-released: "2026-07-09"
url: "https://skillstore.io/skills/dyai2025-condition-based-waiting/audits/10"
identifiers:
- type: other
value: "skillstore:dyai2025-condition-based-waiting:audit:10"
description: "Skillstore immutable audit report identifier"
Skillstore Score
Why this score Evidence Confidence: MediumWhat You Can Build
Fix flaky CI tests
Replace sleep-based waits with condition checks that pass under different machine speeds and loads.
Improve async integration tests
Wait for events, state changes, or result counts before making assertions in asynchronous workflows.
Review test reliability patterns
Find timing guesses and decide whether to poll for state or document a real timing requirement.
Try These Prompts
Use condition-based-waiting to review this test file for setTimeout, sleep, or fixed delay patterns. Explain which waits should become condition checks.
Use condition-based-waiting to replace this arbitrary delay with a waitFor condition. Keep the test intent the same and include a clear timeout message.
Use condition-based-waiting to design helper functions for waiting on event type, event count, and event predicates in this test suite.
Use condition-based-waiting to audit these tests. Separate true timing behavior tests from flaky timing guesses, and recommend the smallest safe changes.
Best Practices
- Wait for the specific state, event, count, or file condition that proves readiness.
- Always include a timeout with an error message that names the condition being awaited.
- Poll fresh state inside the loop instead of caching values before the wait begins.
Avoid
- Do not add arbitrary sleeps because a test sometimes fails in CI.
- Do not poll every millisecond unless the timing requirement is justified.
- Do not use condition waiting for tests that are explicitly about timing intervals.
Frequently Asked Questions
What problem does this skill solve?
Can I still use setTimeout in tests?
What should a wait condition check?
How long should the polling interval be?
Does this skill include runnable utilities?
Is this skill specific to Claude Code?
Developer Details
Author
DYAI2025License
MIT
Skillstore revision
r1
Version notice
The author did not declare a version.
Ref
1ffa7643651792ccb4bd3b15d924d2c97edff755
Maintenance freshness
7/18/2026
Usage
5 downloads ยท 199 views
File structure