test(e2e): queue downloads on a silent peer, not a user who does not exist
Two daemon tests cancel a download that has to still be waiting, and both waited on e2e_ghost_peer, a user who never logs in. That only ever worked inside a timer: the download sat unconnected until the 20-second broker timeout failed it, and the tests cancelled inside that window. Since CantConnectToPeer ends the wait on downloads for a peer the server cannot reach, soulfind answers the brokered dial straight away and the download fails before the cancel lands. The CLI test failed on every daemon-mode run, which is what blocked the v19.0.0 release; the protocol suite's twin only passed because its cancel raced the server's answer and won. Both now download from a silent peer: a raw login whose announced listener accepts the connection and never replies, so the download stays queued the way it does behind a busy peer, for as long as the test needs it.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
mod common;
|
||||
|
||||
use common::{CLI_ENV_VARS, Soulfind, free_port, login, settle};
|
||||
use common::{CLI_ENV_VARS, Soulfind, free_port, login, settle, silent_peer};
|
||||
use soulseek_rs::Client;
|
||||
use std::io::Write;
|
||||
use std::net::{TcpStream, ToSocketAddrs};
|
||||
@@ -1560,12 +1560,14 @@ fn transfer_cancel_stops_a_download_another_client_is_waiting_on() {
|
||||
return;
|
||||
}
|
||||
let server = server_or_skip!();
|
||||
let _peer =
|
||||
silent_peer(&server.host, server.port, "cli_e2e_cancel_silent_peer");
|
||||
let mut all = server.args("cli_e2e_cancel_waiter");
|
||||
all.extend(
|
||||
[
|
||||
"download",
|
||||
"e2e_ghost_peer",
|
||||
"@@ghost\\never.mp3",
|
||||
"cli_e2e_cancel_silent_peer",
|
||||
"@@silent\\never.mp3",
|
||||
"--size",
|
||||
"10",
|
||||
"--timeout",
|
||||
@@ -1587,7 +1589,12 @@ fn transfer_cancel_stops_a_download_another_client_is_waiting_on() {
|
||||
let output = cli(
|
||||
&server,
|
||||
"cli_e2e_cancel_waiter",
|
||||
&["transfer", "cancel", "e2e_ghost_peer", "@@ghost\\never.mp3"],
|
||||
&[
|
||||
"transfer",
|
||||
"cancel",
|
||||
"cli_e2e_cancel_silent_peer",
|
||||
"@@silent\\never.mp3",
|
||||
],
|
||||
);
|
||||
if code(&output) == EXIT_OK {
|
||||
cancelled = Some(output);
|
||||
|
||||
Reference in New Issue
Block a user