diff options
Diffstat (limited to 'tests/common/relay.rs')
| -rw-r--r-- | tests/common/relay.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/common/relay.rs b/tests/common/relay.rs index 227849a..b1e96cf 100644 --- a/tests/common/relay.rs +++ b/tests/common/relay.rs | |||
| @@ -204,7 +204,7 @@ impl TestRelay { | |||
| 204 | .env("NGIT_GIT_DATA_PATH", git_data_dir.path()) | 204 | .env("NGIT_GIT_DATA_PATH", git_data_dir.path()) |
| 205 | .env("NGIT_DATABASE_BACKEND", "memory") // Force in-memory database for isolation | 205 | .env("NGIT_DATABASE_BACKEND", "memory") // Force in-memory database for isolation |
| 206 | .env("NGIT_OWNER_NPUB", &test_npub) | 206 | .env("NGIT_OWNER_NPUB", &test_npub) |
| 207 | .env("NGIT_SYNC_BATCH_WINDOW_MS", "200") // Fast batch window for tests (200ms instead of 5s default) | 207 | .env("NGIT_TEST", "1") // Enable test mode: fast timers (200ms batch window, 200ms purgatory sync) |
| 208 | .env("NGIT_SYNC_STARTUP_DELAY_SECS", "0") // No startup delay for faster tests | 208 | .env("NGIT_SYNC_STARTUP_DELAY_SECS", "0") // No startup delay for faster tests |
| 209 | .env("NGIT_SYNC_STARTUP_JITTER_MS", "0") // No jitter for tests | 209 | .env("NGIT_SYNC_STARTUP_JITTER_MS", "0") // No jitter for tests |
| 210 | .env("NGIT_SYNC_DISCONNECT_CHECK_INTERVAL_SECS", "1") // Fast reconnect attempts for tests | 210 | .env("NGIT_SYNC_DISCONNECT_CHECK_INTERVAL_SECS", "1") // Fast reconnect attempts for tests |
| @@ -213,8 +213,15 @@ impl TestRelay { | |||
| 213 | "RUST_LOG", | 213 | "RUST_LOG", |
| 214 | std::env::var("RUST_LOG").unwrap_or_else(|_| "info".to_string()), | 214 | std::env::var("RUST_LOG").unwrap_or_else(|_| "info".to_string()), |
| 215 | ) // Use RUST_LOG from environment or default to info | 215 | ) // Use RUST_LOG from environment or default to info |
| 216 | .stdout(Stdio::null()) // Suppress stdout for cleaner test output | 216 | .stdout( |
| 217 | .stderr(Stdio::null()); // Suppress stderr for cleaner test output | 217 | std::fs::OpenOptions::new() |
| 218 | .create(true) | ||
| 219 | .append(true) | ||
| 220 | .open(format!("/tmp/relay-{}.log", port)) | ||
| 221 | .map(Stdio::from) | ||
| 222 | .unwrap_or(Stdio::null()), | ||
| 223 | ) | ||
| 224 | .stderr(Stdio::inherit()); // Inherit stderr for test output | ||
| 218 | 225 | ||
| 219 | // Add bootstrap relay URL if provided | 226 | // Add bootstrap relay URL if provided |
| 220 | if let Some(ref bootstrap_url) = bootstrap_relay_url { | 227 | if let Some(ref bootstrap_url) = bootstrap_relay_url { |