mirror of
https://github.com/zed-industries/zed.git
synced 2026-12-01 21:10:37 +01:00
Fix a flaky terminal test (#65160)
CI example: https://github.com/zed-industries/zed/actions/runs/37274127321/job/111647574180?pr=65158 `true` could exit before the test checked for active PTY resources. The ACP completion task releases those resources immediately after exit, so correct cleanup could fail the assertion. Release Notes: - N/A
This commit is contained in:
@@ -4070,7 +4070,7 @@ mod internal_tests {
|
||||
let task = cx.update(|cx| {
|
||||
tool.run(
|
||||
ToolInput::resolved(SandboxedTerminalToolInput {
|
||||
command: "true".to_string(),
|
||||
command: "read -r line </dev/tty".to_string(),
|
||||
cd: temp_dir.path().to_string_lossy().into_owned(),
|
||||
..Default::default()
|
||||
}),
|
||||
@@ -4107,11 +4107,10 @@ mod internal_tests {
|
||||
"the full terminal tool path should create a real PTY"
|
||||
);
|
||||
|
||||
historical_terminal.update(cx, |terminal, _cx| terminal.input(b"\n".to_vec()));
|
||||
|
||||
let result = task.await.expect("native terminal tool call succeeds");
|
||||
assert!(
|
||||
result.contains("Command executed successfully."),
|
||||
"unexpected terminal tool result: {result}"
|
||||
);
|
||||
assert_eq!(result, "Command executed successfully.");
|
||||
assert!(
|
||||
historical_terminal.read_with(cx, |terminal, _cx| {
|
||||
terminal.is_pty() && terminal.pid_getter().is_some()
|
||||
|
||||
Reference in New Issue
Block a user