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:
co-authored by
Claude Fable 5
parent
a1fc85b62d
commit
9198640bd9
@@ -78,6 +78,11 @@ fn wait_complete(socket: &Path, hash: &str, timeout: Duration) -> bool {
|
|||||||
false
|
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
|
/// 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.
|
/// attacker who learned a hash out of band would hand to their daemon.
|
||||||
fn forge_ticket(real_ticket: &str, target_hash: &str) -> String {
|
fn forge_ticket(real_ticket: &str, target_hash: &str) -> String {
|
||||||
@@ -225,6 +230,7 @@ fn subscribe_streams_progress_and_completion() {
|
|||||||
/// sibling process.
|
/// sibling process.
|
||||||
#[test]
|
#[test]
|
||||||
fn overlapping_pins_auto_sync_via_lan_discovery() {
|
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_a = tempfile::tempdir().unwrap();
|
||||||
let dir_b = tempfile::tempdir().unwrap();
|
let dir_b = tempfile::tempdir().unwrap();
|
||||||
let a = support::spawn_daemon_with_env(dir_a.path(), &[("VARDE_DISCOVERY", "true")]);
|
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.
|
/// accepted, so the content survives gc and lists as a pin.
|
||||||
#[test]
|
#[test]
|
||||||
fn push_hands_content_to_trusted_peer() {
|
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_a = tempfile::tempdir().unwrap();
|
||||||
let dir_b = tempfile::tempdir().unwrap();
|
let dir_b = tempfile::tempdir().unwrap();
|
||||||
let a = support::spawn_daemon_with_env(dir_a.path(), &[("VARDE_DISCOVERY", "true")]);
|
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.
|
// 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 {
|
let reply = client_b.request(&Request::Status {
|
||||||
hash: Some(hash.clone()),
|
hash: Some(hash.clone()),
|
||||||
});
|
});
|
||||||
panic!("pushed content not complete on receiver; status: {reply:?}");
|
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 {
|
loop {
|
||||||
let reply = client_b.request(&Request::List {});
|
let reply = client_b.request(&Request::List {});
|
||||||
if let Some(ResponseData::Pins { pins }) = &reply.data {
|
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.
|
/// the push, even though the sender trusts the receiver.
|
||||||
#[test]
|
#[test]
|
||||||
fn push_rejected_without_receiver_trust() {
|
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_a = tempfile::tempdir().unwrap();
|
||||||
let dir_b = tempfile::tempdir().unwrap();
|
let dir_b = tempfile::tempdir().unwrap();
|
||||||
let a = support::spawn_daemon_with_env(dir_a.path(), &[("VARDE_DISCOVERY", "true")]);
|
let a = support::spawn_daemon_with_env(dir_a.path(), &[("VARDE_DISCOVERY", "true")]);
|
||||||
|
|||||||
Reference in New Issue
Block a user