@@ -32,7 +32,8 @@ export default () =>
3232 const RaiseIntentVoidResult5secs = "(2.0-RaiseIntentVoidResult5secs) App A receives a void IntentResult after a 5 second delay" ;
3333 it ( RaiseIntentVoidResult5secs , async ( ) => {
3434 errorListener = await control . listenForError ( ) ;
35- const receiver = control . receiveContext ( ControlContextType . aTestingIntentListenerTriggered , 8000 ) ;
35+ let receiver = control . receiveContext ( ControlContextType . aTestingIntentListenerTriggered , 8000 ) ;
36+ await wait ( 300 ) // Added due to nested promise await race condition first observed by Jupnit.
3637 const intentResolution = await control . raiseIntent ( Intent . aTestingIntent , ContextType . testContextX , undefined , 5000 ) ;
3738 control . validateIntentResolution ( IntentApp . IntentAppA , intentResolution ) ;
3839 let intentResultPromise = control . getIntentResult ( intentResolution ) ;
@@ -56,7 +57,8 @@ export default () =>
5657 const RaiseIntentContextResult5secs = "(2.0-RaiseIntentContextResult5secs) IntentResult resolves to testContextY instance after a 5 second delay" ;
5758 it ( RaiseIntentContextResult5secs , async ( ) => {
5859 errorListener = await control . listenForError ( ) ;
59- const receiver = control . receiveContext ( ControlContextType . sharedTestingIntent1ListenerTriggered , 8000 ) ;
60+ let receiver = control . receiveContext ( ControlContextType . sharedTestingIntent1ListenerTriggered , 8000 ) ;
61+ await wait ( 300 ) // Added due to nested promise await race condition first observed by Jupnit.
6062 const intentResolution = await control . raiseIntent ( Intent . sharedTestingIntent1 , ContextType . testContextY , undefined , 5000 ) ;
6163 control . validateIntentResolution ( IntentApp . IntentAppB , intentResolution ) ;
6264 const intentResultPromise = control . getIntentResult ( intentResolution ) ;
@@ -71,7 +73,8 @@ export default () =>
7173 const RaiseIntentChannelResult = "(2.0-RaiseIntentChannelResult) IntentResult resolves to a Channel object" ;
7274 it ( RaiseIntentChannelResult , async ( ) => {
7375 errorListener = await control . listenForError ( ) ;
74- const receiver = control . receiveContext ( ControlContextType . sharedTestingIntent2ResultSent , constants . WaitTime ) ;
76+ let receiver = control . receiveContext ( ControlContextType . sharedTestingIntent2ResultSent , constants . WaitTime ) ;
77+ await wait ( 300 ) // Added due to nested promise await race condition first observed by Jupnit.
7578 const intentResolution = await control . raiseIntent ( Intent . sharedTestingIntent2 , ContextType . testContextY , {
7679 appId : IntentApp . IntentAppE ,
7780 } ) ;
@@ -89,6 +92,7 @@ export default () =>
8992 it ( RaiseIntentPrivateChannelResult , async ( ) => {
9093 errorListener = await control . listenForError ( ) ;
9194 let receiver = control . receiveContext ( ControlContextType . sharedTestingIntent2ResultSent , constants . WaitTime ) ;
95+ await wait ( 300 ) // Added due to nested promise await race condition first observed by Jupnit.
9296 const intentResolution = await control . raiseIntent ( Intent . sharedTestingIntent2 , ContextType . testContextY , {
9397 appId : IntentApp . IntentAppF ,
9498 } ) ;
@@ -105,7 +109,8 @@ export default () =>
105109 const RaiseIntentVoidResult61secs = "(2.0-RaiseIntentVoidResult61secs) App A receives a void IntentResult after a 61 second delay" ;
106110 it ( RaiseIntentVoidResult61secs , async ( ) => {
107111 errorListener = await control . listenForError ( ) ;
108- const receiver = control . receiveContext ( ControlContextType . aTestingIntentListenerTriggered , 64000 ) ;
112+ let receiver = control . receiveContext ( ControlContextType . aTestingIntentListenerTriggered , 64000 ) ;
113+ await wait ( 300 ) // Added due to nested promise await race condition first observed by Jupnit.
109114 const intentResolution = await control . raiseIntent ( Intent . aTestingIntent , ContextType . testContextX , undefined , 61000 ) ;
110115 control . validateIntentResolution ( IntentApp . IntentAppA , intentResolution ) ;
111116 let intentResultPromise = control . getIntentResult ( intentResolution ) ;
@@ -120,7 +125,8 @@ export default () =>
120125 const RaiseIntentContextResult61secs = "(2.0-RaiseIntentContextResult61secs) IntentResult resolves to testContextY instance after a 61 second delay" ;
121126 it ( RaiseIntentContextResult61secs , async ( ) => {
122127 errorListener = await control . listenForError ( ) ;
123- const receiver = control . receiveContext ( ControlContextType . sharedTestingIntent1ListenerTriggered , 64000 ) ;
128+ let receiver = control . receiveContext ( ControlContextType . sharedTestingIntent1ListenerTriggered , 64000 ) ;
129+ await wait ( 300 ) // Added due to nested promise await race condition first observed by Jupnit.
124130 const intentResolution = await control . raiseIntent ( Intent . sharedTestingIntent1 , ContextType . testContextY , undefined , 61000 ) ;
125131 control . validateIntentResolution ( IntentApp . IntentAppB , intentResolution ) ;
126132 let intentResultPromise = control . getIntentResult ( intentResolution ) ;
0 commit comments