diff --git a/tests/common/relay.rs b/tests/common/relay.rs index 3ecfca6..7ed8f6f 100644 --- a/tests/common/relay.rs +++ b/tests/common/relay.rs @@ -91,6 +91,9 @@ struct RelayOptions { relay_data_path: Option, deletion_lifecycle: Option, rejected_hot_cache_duration_secs: Option, + /// Application log level for tests that observe a diagnostic as an + /// ordering barrier. Other fixtures retain the production `info` default. + log_level: Option, relay_max_subscriptions: Option, sync_recursive_descendant_limit: Option, private_members: Option, @@ -182,6 +185,23 @@ impl TestRelay { .await } + /// Start a syncing relay with application debug diagnostics enabled. + /// + /// Most integration tests use the production `info` default. This focused + /// fixture supports tests that wait on a debug record as an observable + /// ordering condition before changing remote state. + pub async fn start_with_sync_debug(bootstrap_relay_url: Option) -> Self { + Self::start_internal( + port::reserve_port(), + RelayOptions { + bootstrap_relay_url, + log_level: Some("debug".to_string()), + ..RelayOptions::default() + }, + ) + .await + } + /// Start a syncing relay with a caller-chosen relay-owner identity. /// /// Lets tests stage owner-signed events on other relays before this @@ -263,6 +283,7 @@ impl TestRelay { RelayOptions { bootstrap_relay_url, rejected_hot_cache_duration_secs: Some(rejected_hot_cache_duration_secs), + log_level: Some("debug".to_string()), ..RelayOptions::default() }, ) @@ -764,6 +785,10 @@ impl TestRelay { ); } + if let Some(log_level) = &options.log_level { + cmd.env("NGIT_LOG_LEVEL", log_level); + } + if let Some(limit) = options.relay_max_subscriptions { cmd.env("NGIT_RELAY_MAX_SUBSCRIPTIONS", limit.to_string()); } diff --git a/tests/sync/maintainer_reprocessing.rs b/tests/sync/maintainer_reprocessing.rs index 75438b3..599d9ff 100644 --- a/tests/sync/maintainer_reprocessing.rs +++ b/tests/sync/maintainer_reprocessing.rs @@ -912,7 +912,7 @@ async fn test_acceptance_replaces_existing_invitee_repository_with_newer_owner_s use crate::common::{create_test_repo_with_commit, CommitVariant}; let owner_relay = TestRelay::start_with_sync(None).await; - let invitee_relay = TestRelay::start_with_sync(None).await; + let invitee_relay = TestRelay::start_with_sync_debug(None).await; let shared_relay = TestRelay::start_with_sync(None).await; let owner_keys = Keys::generate(); let invitee_keys = Keys::generate();