Serialize the mdns tests and relax push-test deadlines
ci / quality (push) Failing after 3s

push_hands_content_to_trusted_peer failed on CI: the test harness runs
lan_trust tests in parallel, so the three mdns-dependent tests spawn
six daemons at once — multicast timing and two runner cores don't
survive that. A process-wide mutex runs them one at a time, and the
push deadlines now match the 60s convention of the other transfer
tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Bendik Lynghaug
2026-08-16 15:28:22 +02:00
co-authored by Claude Fable 5
parent a1fc85b62d
commit 9198640bd9
+10 -2
View File
@@ -78,6 +78,11 @@ fn wait_complete(socket: &Path, hash: &str, timeout: Duration) -> bool {
false
}
/// mdns tests spawn two daemons each and depend on multicast timing;
/// run them one at a time so they don't starve each other on small CI
/// runners.
static MDNS_SERIAL: std::sync::Mutex<()> = std::sync::Mutex::new(());
/// Re-target a ticket at another hash on the same provider: what an
/// attacker who learned a hash out of band would hand to their daemon.
fn forge_ticket(real_ticket: &str, target_hash: &str) -> String {
@@ -225,6 +230,7 @@ fn subscribe_streams_progress_and_completion() {
/// sibling process.
#[test]
fn overlapping_pins_auto_sync_via_lan_discovery() {
let _serial = MDNS_SERIAL.lock().unwrap_or_else(|e| e.into_inner());
let dir_a = tempfile::tempdir().unwrap();
let dir_b = tempfile::tempdir().unwrap();
let a = support::spawn_daemon_with_env(dir_a.path(), &[("VARDE_DISCOVERY", "true")]);
@@ -302,6 +308,7 @@ fn wait_peer_connected(client: &mut support::Client, timeout: Duration) -> bool
/// accepted, so the content survives gc and lists as a pin.
#[test]
fn push_hands_content_to_trusted_peer() {
let _serial = MDNS_SERIAL.lock().unwrap_or_else(|e| e.into_inner());
let dir_a = tempfile::tempdir().unwrap();
let dir_b = tempfile::tempdir().unwrap();
let a = support::spawn_daemon_with_env(dir_a.path(), &[("VARDE_DISCOVERY", "true")]);
@@ -349,13 +356,13 @@ fn push_hands_content_to_trusted_peer() {
}
// The receiver has the bytes, and pinned them.
if !wait_complete(&b.socket, &hash, Duration::from_secs(30)) {
if !wait_complete(&b.socket, &hash, Duration::from_secs(60)) {
let reply = client_b.request(&Request::Status {
hash: Some(hash.clone()),
});
panic!("pushed content not complete on receiver; status: {reply:?}");
}
let deadline = Instant::now() + Duration::from_secs(10);
let deadline = Instant::now() + Duration::from_secs(30);
loop {
let reply = client_b.request(&Request::List {});
if let Some(ResponseData::Pins { pins }) = &reply.data {
@@ -383,6 +390,7 @@ fn push_hands_content_to_trusted_peer() {
/// the push, even though the sender trusts the receiver.
#[test]
fn push_rejected_without_receiver_trust() {
let _serial = MDNS_SERIAL.lock().unwrap_or_else(|e| e.into_inner());
let dir_a = tempfile::tempdir().unwrap();
let dir_b = tempfile::tempdir().unwrap();
let a = support::spawn_daemon_with_env(dir_a.path(), &[("VARDE_DISCOVERY", "true")]);