From a046849438c61d989303b8d5549eaae55ed0cf77 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Wed, 25 Feb 2026 09:59:25 +0000 Subject: [PATCH] fix: flaky test due to second-resolution for thread ordering (#12692) --- codex-rs/exec/tests/suite/resume.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codex-rs/exec/tests/suite/resume.rs b/codex-rs/exec/tests/suite/resume.rs index e5074da74..8cd8fffb4 100644 --- a/codex-rs/exec/tests/suite/resume.rs +++ b/codex-rs/exec/tests/suite/resume.rs @@ -278,6 +278,11 @@ fn exec_resume_last_respects_cwd_filter_and_all_flag() -> anyhow::Result<()> { .assert() .success(); + // `resume --last` sorts by `updated_at`, which is second-granularity. Sleep so + // the upcoming `resume --last --all` write lands in a later second and becomes + // deterministically newest (instead of tying and falling back to UUID order). + std::thread::sleep(std::time::Duration::from_millis(1100)); + let marker_b2 = format!("resume-cwd-b-2-{}", Uuid::new_v4()); let prompt_b2 = format!("echo {marker_b2}"); test.cmd()