@@ -175,39 +175,45 @@ export class TestShell {
175175 }
176176
177177 async waitForPrompt ( start = 0 ) : Promise < void > {
178- await eventually ( ( ) => {
179- const output = this . _output . slice ( start ) ;
180- const lines = output . split ( '\n' ) ;
181- const found = ! ! lines
182- . filter ( ( l ) => PROMPT_PATTERN . exec ( l ) ) // a line that is the prompt must at least match the pattern
183- . find ( ( l ) => {
184- // in some situations the prompt occurs multiple times in the line (but only in tests!)
185- const prompts = l
186- . trim ( )
187- . replace ( / > $ / g, '' )
188- . split ( '>' )
189- . map ( ( m ) => m . trim ( ) ) ;
190- // if there are multiple prompt parts they must all equal
191- if ( prompts . length > 1 ) {
192- for ( const p of prompts ) {
193- if ( p !== prompts [ 0 ] ) {
194- return false ;
178+ await eventually (
179+ ( ) => {
180+ const output = this . _output . slice ( start ) ;
181+ const lines = output . split ( '\n' ) ;
182+ const found = ! ! lines
183+ . filter ( ( l ) => PROMPT_PATTERN . exec ( l ) ) // a line that is the prompt must at least match the pattern
184+ . find ( ( l ) => {
185+ // in some situations the prompt occurs multiple times in the line (but only in tests!)
186+ const prompts = l
187+ . trim ( )
188+ . replace ( / > $ / g, '' )
189+ . split ( '>' )
190+ . map ( ( m ) => m . trim ( ) ) ;
191+ // if there are multiple prompt parts they must all equal
192+ if ( prompts . length > 1 ) {
193+ for ( const p of prompts ) {
194+ if ( p !== prompts [ 0 ] ) {
195+ return false ;
196+ }
195197 }
196198 }
197- }
198- return true ;
199- } ) ;
200- if ( ! found ) {
201- throw new assert . AssertionError ( {
202- message : 'expected prompt' ,
203- expected : PROMPT_PATTERN . toString ( ) ,
204- actual :
205- this . _output . slice ( 0 , start ) +
206- '[prompt search starts here]' +
207- output ,
208- } ) ;
199+ return true ;
200+ } ) ;
201+ if ( ! found ) {
202+ throw new assert . AssertionError ( {
203+ message : 'expected prompt' ,
204+ expected : PROMPT_PATTERN . toString ( ) ,
205+ actual :
206+ this . _output . slice ( 0 , start ) +
207+ '[prompt search starts here]' +
208+ output ,
209+ } ) ;
210+ }
211+ } ,
212+ {
213+ // Increased timeout to account for slow startup on MacOS x64 hosts
214+ timeout : 20_000 ,
209215 }
210- } ) ;
216+ ) ;
211217 }
212218
213219 waitForExit ( ) : Promise < number > {
0 commit comments