test(e2e): hand the serve test's share to the daemon, not the run

The serving process built its arguments by hand, so in daemon mode
--shared-dir stayed on the attached run, where shares belong to the
daemon and the flag is ignored. The daemon fell back to sharing its
default folder - which on a developer machine contains the probe files
earlier buggy runs deposited, so the test only passed by finding
served.bin in leftovers. args_with routes the share to the process
whose session does the sharing in either mode.
This commit is contained in:
Michel de Graaf
2026-07-29 17:02:35 +02:00
parent f525984a7b
commit d30e863fae
+9 -10
View File
@@ -2124,18 +2124,17 @@ fn serve_stays_online_and_reports_an_upload_a_peer_pulls() {
std::fs::write(share.path().join("served.bin"), probe_bytes())
.expect("share file");
// A serving process: online, sharing, streaming upload records.
let mut args = server.args("cli_e2e_server");
// A serving process: online, sharing, streaming upload records. The share
// is a session flag: in daemon mode it must reach the daemon, whose
// session does the sharing — handed to the run itself it would be
// silently ignored and the daemon would serve its default folder.
let mut args = server.args_with(
"cli_e2e_server",
&["--shared-dir".to_string(), share.display()],
);
args.retain(|arg| arg != "--quiet");
args.extend(
[
"--shared-dir",
&share.display(),
"--json",
"serve",
"--duration",
"25",
]
["--json", "serve", "--duration", "25"]
.iter()
.map(|a| (*a).to_string()),
);