Wait for patch events before reading shell snapshots (#36757)

## What changed

Move shell snapshot validation in the intercepted `apply_patch` test until after
the turn completes and its patch lifecycle events have been collected.

GitOrigin-RevId: 1c16bcfcc97f09165c4a2eb2d15f4059a14b2a99
This commit is contained in:
jif
2026-08-03 14:14:41 +00:00
committed by copyberry
parent 7750465934
commit c39d3e99d5
+4 -4
View File
@@ -608,10 +608,6 @@ async fn shell_command_snapshot_still_intercepts_apply_patch() -> Result<()> {
})
.await?;
let snapshot_path = wait_for_snapshot(&codex_home).await?;
let snapshot_content = fs::read_to_string(&snapshot_path).await?;
assert_posix_snapshot_sections(&snapshot_content);
let mut saw_patch_begin = false;
let mut patch_end = None;
wait_for_event(&codex, |ev| match ev {
@@ -628,6 +624,10 @@ async fn shell_command_snapshot_still_intercepts_apply_patch() -> Result<()> {
})
.await;
let snapshot_path = wait_for_snapshot(&codex_home).await?;
let snapshot_content = fs::read_to_string(&snapshot_path).await?;
assert_posix_snapshot_sections(&snapshot_content);
assert!(
saw_patch_begin,
"expected apply_patch to emit PatchApplyBegin"