Tests: the font menu and idle-socket tests don't fail on a busy machine

type_font_menu_lists_every_available_family compared two reads of Type › Font while a test running alongside could add a font in between, so the menu was rebuilt with one more family. It now judges a run in which the font generation held still.

idle_expiry_closes_without_writing_a_line took a connection reset as a failure; on Windows the server's close of an idle connection can reach the client as one.
This commit is contained in:
bflatastic
2026-11-04 21:46:50 +07:00
parent dc9b2f087f
commit 292b385a66
2 changed files with 24 additions and 7 deletions
+6 -1
View File
@@ -58,7 +58,12 @@ fn idle_control_socket_releases_its_worker() {
fn idle_expiry_closes_without_writing_a_line() {
let (mut client, done, worker) = socket_fixture(short_timeouts(), |_, _| panic!("no request expected"));
let mut got = Vec::new();
client.read_to_end(&mut got).unwrap();
match client.read_to_end(&mut got) {
// On Windows the server's close can reach the client as a reset.
Err(e) if e.kind() == std::io::ErrorKind::ConnectionReset => {}
Ok(_) => {}
Err(e) => panic!("reading the idle connection: {e}"),
}
assert_eq!(String::from_utf8_lossy(&got), "", "the app wrote to an idle connection");
expect_socket_deadline(client, done, worker);
}