File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,8 +67,13 @@ test('send waits only for matching-session completion and answers permission req
6767 assert . match ( sent . inputId , / ^ [ 0 - 9 a - f - ] { 36 } $ / ) ; assert . equal ( sent . stateRevision , 1 ) ;
6868 await client . waitForCompletion ( sessionId ) ;
6969 assert . deepEqual ( permissions , [ 'write' ] ) ;
70- const calls = ( await readFile ( record , 'utf8' ) ) . trim ( ) . split ( '\n' ) . map ( JSON . parse ) ;
71- assert . ok ( calls . some ( ( entry ) => entry . id === 9000 && entry . result ?. decision === 'allow' ) ) ;
70+ let permissionResponse ;
71+ for ( let attempt = 0 ; attempt < 100 && ! permissionResponse ; attempt += 1 ) {
72+ const calls = ( await readFile ( record , 'utf8' ) ) . trim ( ) . split ( '\n' ) . filter ( Boolean ) . map ( JSON . parse ) ;
73+ permissionResponse = calls . find ( ( entry ) => entry . id === 9000 && entry . result ?. decision === 'allow' ) ;
74+ if ( ! permissionResponse ) await new Promise ( ( resolve ) => setTimeout ( resolve , 5 ) ) ;
75+ }
76+ assert . ok ( permissionResponse ) ;
7277 } , { FAKE_ZCODE_PERMISSION : '1' } ) ;
7378} ) ;
7479
You can’t perform that action at this time.
0 commit comments