mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
Stabilize cross-platform tests and directory-change fork permissions (#59369)
## Why Tests need to distinguish slow subprocess startup from operation timeouts and wait for asynchronous work before asserting results or cleaning up fixtures. ## What changed - Synchronize subprocess readiness, queued-turn completion, and matching UI events; allow more time for cold startup and separate startup from shutdown deadlines. - Adapt Windows fixtures and permission expectations, provide the voice-host test runtime DLL path, and normalize platform paths and animated status snapshots. - Use current configuration permissions when changing directories in embedded TUI sessions, while retaining saved permissions for remote sessions. - Allow the release prompt-prefix comparison to accept the exact image-tool description update that removes image detail options, and refresh the corresponding tool snapshot. ## Testing Extend inherited-session metadata coverage to both legacy and paginated thread history, including persisted history mode and revision-aware resume. GitOrigin-RevId: 0afb38403fc0adb0d83175344749584f0cdf9979
This commit is contained in:
committed by
copyberry
parent
71a4c07036
commit
021fccb046
@@ -37,19 +37,40 @@ async fn assert_timed_out_git_wrapper_does_not_leave_child_process_running(
|
||||
};
|
||||
#[cfg(windows)]
|
||||
let mut command = {
|
||||
let mut command = Command::new("powershell.exe");
|
||||
let child_command = "Set-Content -LiteralPath $env:CHILD_READY_FILE -Value ready; while (-not (Test-Path $env:RELEASE_CHILD_FILE)) { Start-Sleep -Milliseconds 25 }; Start-Sleep -Seconds 1; Set-Content -LiteralPath $env:CHILD_SURVIVED_FILE -Value survived; Start-Sleep -Seconds 60";
|
||||
let wrapper_command = match wrapper_lifetime {
|
||||
GitWrapperLifetime::WaitForChild => format!(
|
||||
"$child = Start-Process -FilePath powershell.exe -ArgumentList @('-NoProfile', '-NonInteractive', '-Command', '{child_command}') -PassThru -NoNewWindow; [System.IO.File]::WriteAllText($env:CHILD_PID_FILE, [string]$child.Id); Wait-Process -Id $child.Id"
|
||||
),
|
||||
GitWrapperLifetime::ExitBeforeTimeout => format!(
|
||||
"$child = Start-Process -FilePath powershell.exe -ArgumentList @('-NoProfile', '-NonInteractive', '-Command', '{child_command}') -PassThru -NoNewWindow; [System.IO.File]::WriteAllText($env:CHILD_PID_FILE, [string]$child.Id); while (-not (Test-Path $env:RELEASE_WRAPPER_FILE)) {{ Start-Sleep -Milliseconds 25 }}"
|
||||
),
|
||||
};
|
||||
command
|
||||
.args(["-NoProfile", "-NonInteractive", "-Command"])
|
||||
.arg(wrapper_command);
|
||||
let script = temp_dir.path().join("git_wrapper.py");
|
||||
std::fs::write(
|
||||
&script,
|
||||
r#"import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
def wait_for(name):
|
||||
while not Path(os.environ[name]).exists():
|
||||
time.sleep(0.025)
|
||||
|
||||
if sys.argv[1] == "child":
|
||||
Path(os.environ["CHILD_READY_FILE"]).touch()
|
||||
wait_for("RELEASE_CHILD_FILE")
|
||||
time.sleep(1)
|
||||
Path(os.environ["CHILD_SURVIVED_FILE"]).touch()
|
||||
time.sleep(60)
|
||||
else:
|
||||
child = subprocess.Popen([sys.executable, __file__, "child"])
|
||||
Path(os.environ["CHILD_PID_FILE"]).write_text(str(child.pid))
|
||||
if sys.argv[1] == "wait":
|
||||
child.wait()
|
||||
else:
|
||||
wait_for("RELEASE_WRAPPER_FILE")
|
||||
"#,
|
||||
)
|
||||
.expect("write Git wrapper fixture");
|
||||
let mut command = Command::new("python.exe");
|
||||
command.arg(script).arg(match wrapper_lifetime {
|
||||
GitWrapperLifetime::WaitForChild => "wait",
|
||||
GitWrapperLifetime::ExitBeforeTimeout => "exit",
|
||||
});
|
||||
command
|
||||
};
|
||||
command
|
||||
|
||||
Reference in New Issue
Block a user