File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
tui_app_server/tests/suite Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,12 @@ trust_level = "trusted"
140140 let writer_tx = session. writer_sender ( ) ;
141141 let interrupt_writer = writer_tx. clone ( ) ;
142142 let interrupt_task = tokio:: spawn ( async move {
143- sleep ( Duration :: from_secs ( 2 ) ) . await ;
143+ let interrupt_delay = if cfg ! ( target_os = "macos" ) {
144+ Duration :: from_secs ( 4 )
145+ } else {
146+ Duration :: from_secs ( 2 )
147+ } ;
148+ sleep ( interrupt_delay) . await ;
144149 for _ in 0 ..4 {
145150 let _ = interrupt_writer. send ( vec ! [ 3 ] ) . await ;
146151 sleep ( Duration :: from_millis ( 500 ) ) . await ;
@@ -176,8 +181,11 @@ trust_level = "trusted"
176181 anyhow:: bail!( "timed out waiting for codex resume to exit" ) ;
177182 }
178183 } ;
184+ let clean_interrupt = String :: from_utf8_lossy ( & output) . trim ( ) == "^C" ;
179185 anyhow:: ensure!(
180- exit_code == 0 || exit_code == 130 ,
186+ exit_code == 0
187+ || exit_code == 130
188+ || ( cfg!( target_os = "macos" ) && exit_code == 1 && clean_interrupt) ,
181189 "unexpected exit code from codex resume: {exit_code}; output: {}" ,
182190 String :: from_utf8_lossy( & output)
183191 ) ;
Original file line number Diff line number Diff line change @@ -140,7 +140,12 @@ trust_level = "trusted"
140140 let writer_tx = session. writer_sender ( ) ;
141141 let interrupt_writer = writer_tx. clone ( ) ;
142142 let interrupt_task = tokio:: spawn ( async move {
143- sleep ( Duration :: from_secs ( 2 ) ) . await ;
143+ let interrupt_delay = if cfg ! ( target_os = "macos" ) {
144+ Duration :: from_secs ( 4 )
145+ } else {
146+ Duration :: from_secs ( 2 )
147+ } ;
148+ sleep ( interrupt_delay) . await ;
144149 for _ in 0 ..4 {
145150 let _ = interrupt_writer. send ( vec ! [ 3 ] ) . await ;
146151 sleep ( Duration :: from_millis ( 500 ) ) . await ;
@@ -176,8 +181,11 @@ trust_level = "trusted"
176181 anyhow:: bail!( "timed out waiting for codex resume to exit" ) ;
177182 }
178183 } ;
184+ let clean_interrupt = String :: from_utf8_lossy ( & output) . trim ( ) == "^C" ;
179185 anyhow:: ensure!(
180- exit_code == 0 || exit_code == 130 ,
186+ exit_code == 0
187+ || exit_code == 130
188+ || ( cfg!( target_os = "macos" ) && exit_code == 1 && clean_interrupt) ,
181189 "unexpected exit code from codex resume: {exit_code}; output: {}" ,
182190 String :: from_utf8_lossy( & output)
183191 ) ;
You can’t perform that action at this time.
0 commit comments