bee:condition-based-waiting

Replace arbitrary timeouts with condition polling for deterministic test execution.

2|1|Updated Mar 3, 2026
One-click install
npx skills add https://github.com/luanrodrigues/ia-frmwrk --skill bee-condition-based-waiting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bee:condition-based-waiting
Source: https://github.com/luanrodrigues/ia-frmwrk/tree/main/default/skills/condition-based-waiting
Command: npx skills add https://github.com/luanrodrigues/ia-frmwrk --skill bee-condition-based-waiting

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill eliminates flaky tests caused by arbitrary timeouts by implementing condition-based polling, ensuring tests wait for actual state changes rather than guessing durations.

Core Features & Use Cases

  • Replaces Arbitrary Timeouts: Swaps setTimeout or sleep with intelligent waiting for specific conditions.
  • Fixes Flaky Tests: Improves test reliability by removing race conditions common in CI or under load.
  • Handles Async Operations: Reliably waits for asynchronous operations to complete before asserting results.
  • Use Case: In an e-commerce test suite, instead of waiting 500ms for an order to process, this Skill waits until the order status explicitly changes to 'completed', making the test faster and more reliable.

Quick Start

Use the condition-based waiting skill to wait for the user.isLoggedIn state to become true before proceeding.

Frequently Asked Questions about bee:condition-based-waiting

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

FAQPage Schema
How do I fix flaky tests caused by arbitrary timeouts in my automated test suite?

Fix flaky tests by replacing arbitrary timeouts with condition-based polling that waits for actual state changes. This ensures tests proceed only after specific conditions are met, eliminating intermittent failures caused by timing issues.

What is condition-based polling and how does it handle async operations in testing?

Condition-based polling is a waiting mechanism that repeatedly checks for specific state changes rather than pausing execution for a fixed duration. It handles async operations by waiting until the target condition is explicitly met before proceeding.

Why does my test suite fail intermittently under load in CI/CD pipelines?

Test suites fail intermittently under load due to race conditions and arbitrary timeouts that guess execution durations. Replacing fixed waits with condition-based polling resolves these timing issues by waiting for actual state changes.

Can I use condition polling to wait for a specific state change instead of a fixed sleep duration?

Yes, you can use condition polling to wait for a specific state change instead of a fixed sleep duration. It replaces arbitrary timeouts by continuously checking until the target condition, such as a user login state, becomes true.

When should I avoid using arbitrary timeouts to fix race conditions in automated tests?

Avoid using arbitrary timeouts when tests fail intermittently due to timing issues or race conditions. Fixed durations cannot account for variable execution speeds, so condition-based polling is required to wait reliably for actual state changes.