Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(core): simplify fixture initialization in observability tests

Steven Enamakela6da68b77534
diff --git a/crates/openhuman-core/src/core/observability_tests.rs b/crates/openhuman-core/src/core/observability_tests.rs
index 5049c2ddc4..dd90ab6486 100644
--- a/crates/openhuman-core/src/core/observability_tests.rs
+++ b/crates/openhuman-core/src/core/observability_tests.rs
@@ -61,24 +61,23 @@ fn register_backend_classifier_fixture(message: &str, classification: BackendErr
static FIXTURES: OnceLock<Arc<Mutex<HashMap<String, BackendErrorClassification>>>> =
OnceLock::new();
let fixtures = Arc::clone(FIXTURES.get_or_init(|| {
- let fixtures = Arc::new(Mutex::new(HashMap::new()));
- let classifier_fixtures = Arc::clone(&fixtures);
- register_backend_error_classifier(Arc::new(move |_provider, error| {
- classifier_fixtures
- .lock()
- .expect("classifier fixture lock")
- .get(error)
- .cloned()
- .unwrap_or(BackendErrorClassification {
- provider_owned: false,
- backend_owned: false,
- reportable: true,
- token: None,
- kind: None,
- malformed_bad_request: false,
- })
- }));
- fixtures
+ Arc::new(Mutex::new(HashMap::new()))
+ }));
+ let classifier_fixtures = Arc::clone(&fixtures);
+ register_backend_error_classifier(Arc::new(move |_provider, error| {
+ classifier_fixtures
+ .lock()
+ .expect("classifier fixture lock")
+ .get(error)
+ .cloned()
+ .unwrap_or(BackendErrorClassification {
+ provider_owned: false,
+ backend_owned: false,
+ reportable: true,
+ token: None,
+ kind: None,
+ malformed_bad_request: false,
+ })
}));
fixtures
.lock()