condition-based-waiting

Replace arbitrary timeouts with condition polling for state changes.

3|1|Updated Oct 9, 2025
One-click install
npx skills add https://github.com/OmniNode-ai/omniclaude --skill condition-based-waiting-omninode-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: condition-based-waiting
Source: https://github.com/OmniNode-ai/omniclaude/tree/main/plugins/onex/skills/condition-based-waiting
Command: npx skills add https://github.com/OmniNode-ai/omniclaude --skill condition-based-waiting-omninode-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill replaces arbitrary timeouts in tests with condition polling, directly addressing race conditions and timing dependencies that cause flaky tests.

Core Features & Use Cases

  • Condition Polling: Waits for specific state changes or events instead of fixed durations.
  • Flaky Test Resolution: Significantly reduces test failures due to timing inconsistencies.
  • Use Case: In an asynchronous application test, instead of waiting 500ms for a UI element to appear, use this Skill to poll until the element's visibility property becomes true.

Quick Start

Use the condition-based-waiting skill to wait for the 'user-ready' event to be emitted.

Frequently Asked Questions about condition-based-waiting

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

FAQPage Schema
How do I stop flaky tests caused by asynchronous operations and race conditions?

To stop flaky tests caused by asynchronous operations, replace arbitrary fixed timeouts with condition polling. This approach waits for actual state changes or events, directly resolving timing dependencies that cause inconsistent test results.

What is condition polling and how does it work for async testing?

Condition polling is a testing mechanism that repeatedly checks for specific state changes instead of waiting for fixed durations. It works by implementing a generic polling function with configurable timeouts and error handling to wait until an event is emitted or a property becomes true.

How do I replace arbitrary timeouts with smart waits in UI testing?

Replace arbitrary timeouts with smart waits by polling until a specific UI element state change occurs. For example, instead of waiting 500ms for an element to appear, poll until the element's visibility property becomes true to ensure accurate test execution.

Can I use condition polling for event-driven systems without adding fixed delays?

Yes, you can use condition polling for event-driven systems without fixed delays. The polling function waits for specific events to be emitted, such as a user-ready event, using configurable timeouts and error handling to manage asynchronous state changes accurately.

Does condition-based waiting support configurable timeouts and error handling?

Condition-based waiting supports configurable timeouts and error handling through a generic polling function. This allows you to specify maximum wait durations and manage exceptions while polling for actual state changes in asynchronous or event-driven testing scenarios.

When should I avoid using fixed timeouts and start polling for state changes?

You should avoid fixed timeouts and start polling for state changes in asynchronous operations, event-driven systems, and UI testing scenarios. Timing dependencies in these environments cause flaky tests, which polling resolves by waiting for actual state transitions rather than arbitrary durations.