Skip to content

[TEST] Implement fault tolerance API for test_fault_tolerance.cpp (ARC-001 Phase 1) #329

Description

@kcenon

Summary

The test_fault_tolerance.cpp test file requires fault tolerance APIs that are not yet implemented.

Related

Required API Implementation

The test expects the following classes/functions that do not exist:

Classes

  • retry_executor<T> - Template class for executing operations with retry logic
    • execute(func) -> result<T>
    • get_metrics() -> retry_metrics
    • reset_metrics()
  • fault_tolerance_manager<T> - Template class combining circuit breaker and retry
    • execute(func) -> result<T>
    • execute_with_timeout(func, timeout) -> result<T>
    • get_metrics() -> fault_tolerance_metrics
    • is_healthy() -> result<bool>
  • fault_tolerance_config - Configuration for fault tolerance manager

Functions

  • global_circuit_breaker_registry() - Global registry for circuit breakers
  • global_retry_executor_registry() - Global registry for retry executors
  • global_fault_tolerance_registry() - Global registry for fault tolerance managers
  • create_exponential_backoff_config(max_attempts, base_delay) - Config factory
  • create_fixed_delay_config(max_attempts, delay) - Config factory
  • create_fibonacci_backoff_config(max_attempts, base_delay) - Config factory

Configuration Validation

  • circuit_breaker_config::validate() -> bool
  • retry_config::validate() -> bool
  • fault_tolerance_config::validate() -> bool

Enhancements to circuit_breaker

  • Return result<T> from execute() instead of throwing exceptions

Tasks

  • Implement retry_executor<T> with configurable retry strategies
  • Implement fault_tolerance_config
  • Implement template fault_tolerance_manager<T>
  • Add global registries for all fault tolerance components
  • Add config factory functions
  • Add config validation methods
  • Modify circuit_breaker::execute() to return result<T>
  • Enable test in CMakeLists.txt
  • Verify all tests pass

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions