From 6144aa218efcc41d4ccb546d73443de65606ce0f Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sun, 26 Apr 2026 17:11:01 +0300 Subject: test: fix flaky pid file stability test --- tests/cli_wrapper.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'tests/cli_wrapper.rs') diff --git a/tests/cli_wrapper.rs b/tests/cli_wrapper.rs index 3f71d5d1..3f81b371 100644 --- a/tests/cli_wrapper.rs +++ b/tests/cli_wrapper.rs @@ -243,7 +243,7 @@ fn wait_for_pid_file_errors_when_file_never_contains_pid() { } #[test] -fn wait_for_pid_file_rejects_partial_write_race_until_stable_contents() { +fn wait_for_pid_file_rejects_unparseable_partial_write_until_stable_contents() { let base = unique_test_dir(); fs::create_dir_all(&base).unwrap(); let pid_file = base.join("partial-race.pid"); @@ -253,12 +253,10 @@ fn wait_for_pid_file_rejects_partial_write_race_until_stable_contents() { let pid_file = pid_file.clone(); move || { thread::sleep(Duration::from_millis(40)); - fs::write(&pid_file, "12").unwrap(); + fs::write(&pid_file, "pid=").unwrap(); thread::sleep(Duration::from_millis(40)); - fs::write(&pid_file, "123").unwrap(); + fs::write(&pid_file, "pid=424242").unwrap(); thread::sleep(Duration::from_millis(40)); - fs::write(&pid_file, "1234").unwrap(); - thread::sleep(Duration::from_millis(200)); fs::write(&pid_file, "424242\n").unwrap(); } }); -- cgit v1.2.3