Function lock

Source
pub fn lock() -> ConfigLock
Expand description

Acquire the global configuration lock for testing.

This function returns a ConfigLock that acts as both a write lock guard (preventing other tests from modifying global config concurrently) and as the only way to create configuration overrides.

Example usage:

let config = hyperactor::config::global::lock();
let _guard = config.override_key(CONFIG_KEY, "value");
// ... test code using the overridden config ...