Skip to content

feat: Make wait_for_orchestration timeout configurable in StressTestConfig #31

@affandar

Description

@affandar

Problem

The stress test framework in src/provider_stress_test/core.rs has a hardcoded 60-second timeout for wait_for_orchestration:

// src/provider_stress_test/core.rs:177
match client_clone
    .wait_for_orchestration(&instance, std::time::Duration::from_secs(60))
    .await

This causes issues when running stress tests against high-latency remote databases (e.g., Azure PostgreSQL with 200-300ms query latency). The large payload test with 20 activities + 5 sub-orchestrations creates ~80-100 history events, and each fetch_history call takes 1-2 seconds, easily exceeding the 60-second timeout.

Proposed Solution

Add a configurable timeout field to StressTestConfig:

/// Configuration for stress tests
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StressTestConfig {
    /// Maximum number of concurrent orchestrations
    pub max_concurrent: usize,
    /// Duration to run the test (seconds)
    pub duration_secs: u64,
    /// Number of tasks each orchestration fans out to
    pub tasks_per_instance: usize,
    /// Simulated activity execution time (ms)
    pub activity_delay_ms: u64,
    /// Orchestration dispatcher concurrency
    pub orch_concurrency: usize,
    /// Worker dispatcher concurrency
    pub worker_concurrency: usize,
    /// Timeout for wait_for_orchestration (seconds) - NEW
    pub wait_timeout_secs: u64,
}

impl Default for StressTestConfig {
    fn default() -> Self {
        Self {
            // ... existing defaults ...
            wait_timeout_secs: 60, // Backward compatible default
        }
    }
}

Then use it in the stress test loop:

match client_clone
    .wait_for_orchestration(&instance, std::time::Duration::from_secs(config.wait_timeout_secs))
    .await

Impact

This change would allow provider implementers to configure appropriate timeouts based on their deployment environment without sacrificing test coverage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duroxide-pgIssues reported by duroxide-pg-opt provider

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions