aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJJ Liebig <jonathan.liebig@gmail.com>2026-09-14 22:41:54 +0200
committerGitHub <noreply@github.com>2026-09-14 22:41:54 +0200
commite61206cc9d4e13688d2baed4a866c2bcd6ec0736 (patch)
tree9fbab1165d08f5b34598486d8c24b2714f4791ce /tests
parentf867dabbe676255e75a512df343617bd4ca45d0d (diff)
test: deflake recent CI failures (#4139)
Diffstat (limited to 'tests')
-rw-r--r--tests/client_mode.rs11
-rw-r--r--tests/multi_client.rs19
2 files changed, 11 insertions, 19 deletions
diff --git a/tests/client_mode.rs b/tests/client_mode.rs
index 9a6bee7d..a946af7c 100644
--- a/tests/client_mode.rs
+++ b/tests/client_mode.rs
@@ -1012,12 +1012,15 @@ fn federated_client_starts_without_local_and_survives_its_restart() {
local.child.kill().unwrap();
local.close_master();
drop(local);
- input
- .write_all(b"printf 'REMOTE_%s\\n' SURVIVED\r")
- .unwrap();
assert!(
wait_until(Duration::from_secs(8), Duration::from_millis(20), || {
- screen_text().contains("REMOTE_SURVIVED")
+ if screen_text().contains("REMOTE_SURVIVED") {
+ return true;
+ }
+ input
+ .write_all(b"printf 'REMOTE_%s\\n' SURVIVED\r")
+ .unwrap();
+ false
}),
"Local loss must not interrupt remote input or output: {}",
screen_text()
diff --git a/tests/multi_client.rs b/tests/multi_client.rs
index 823fa0c1..04f5ed0f 100644
--- a/tests/multi_client.rs
+++ b/tests/multi_client.rs
@@ -75,17 +75,6 @@ fn wait_for_socket(path: &Path, timeout: Duration) {
panic!("socket did not appear at {}", path.display());
}
-fn wait_for_file(path: &Path, timeout: Duration) {
- let deadline = Instant::now() + timeout;
- while Instant::now() < deadline {
- if path.exists() {
- return;
- }
- thread::sleep(Duration::from_millis(25));
- }
- panic!("socket did not appear at {}", path.display());
-}
-
fn spawn_server(config: &Path, runtime: &Path, api: &Path) -> SpawnedHerdr {
fs::create_dir_all(config.join("herdr")).unwrap();
fs::create_dir_all(runtime).unwrap();
@@ -285,7 +274,7 @@ fn same_tab_geometry_follows_meaningful_client_activity() {
let clients = runtime.join("herdr-client.sock");
let server = spawn_server(&config, &runtime, &api);
wait_for_socket(&api, Duration::from_secs(10));
- wait_for_file(&clients, Duration::from_secs(10));
+ wait_for_socket(&clients, Duration::from_secs(10));
let pane = create_pane(&api, "effective-size");
let _large = shell(&clients, 120, 40);
let mut small = shell(&clients, 80, 24);
@@ -318,7 +307,7 @@ fn api_pane_output_is_fanned_out_as_pane_surface_updates() {
let clients = runtime.join("herdr-client.sock");
let server = spawn_server(&config, &runtime, &api);
wait_for_socket(&api, Duration::from_secs(10));
- wait_for_file(&clients, Duration::from_secs(10));
+ wait_for_socket(&clients, Duration::from_secs(10));
let pane = create_pane(&api, "fanout");
let mut a = shell(&clients, 100, 30);
let mut b = shell(&clients, 100, 30);
@@ -352,7 +341,7 @@ fn crashed_client_shell_does_not_affect_survivor() {
let clients = runtime.join("herdr-client.sock");
let server = spawn_server(&config, &runtime, &api);
wait_for_socket(&api, Duration::from_secs(10));
- wait_for_file(&clients, Duration::from_secs(10));
+ wait_for_socket(&clients, Duration::from_secs(10));
let mut survivor = shell(&clients, 100, 30);
let crashed = spawn_client(&config, &runtime, &api);
// Give the supported client process time to complete its ClientShell hello;
@@ -385,7 +374,7 @@ fn rapid_client_shell_connect_disconnect_remains_healthy() {
let clients = runtime.join("herdr-client.sock");
let server = spawn_server(&config, &runtime, &api);
wait_for_socket(&api, Duration::from_secs(10));
- wait_for_file(&clients, Duration::from_secs(10));
+ wait_for_socket(&clients, Duration::from_secs(10));
for i in 0..10 {
let mut client = shell(&clients, 80 + i, 24);
send_detach(&mut client).unwrap();