cflx 0.6.130

Conflux – a spec-driven parallel coding orchestrator that runs AI agents on git worktrees
1
2
3
4
5
6
7
8
9
10
//! Shared test helpers for integration tests.

use std::sync::{Mutex, MutexGuard, OnceLock};

/// Process-wide lock for tests that mutate environment variables
/// like PATH/HOME and other process-global state.
pub fn env_lock() -> MutexGuard<'static, ()> {
    static LOCK: OnceLock<Mutex<()>> = OnceLock::new();
    LOCK.get_or_init(|| Mutex::new(())).lock().unwrap()
}