@@ -32,7 +32,8 @@ export default () =>
32
32
const RaiseIntentVoidResult5secs = "(2.0-RaiseIntentVoidResult5secs) App A receives a void IntentResult after a 5 second delay" ;
33
33
it ( RaiseIntentVoidResult5secs , async ( ) => {
34
34
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.
36
37
const intentResolution = await control . raiseIntent ( Intent . aTestingIntent , ContextType . testContextX , undefined , 5000 ) ;
37
38
control . validateIntentResolution ( IntentApp . IntentAppA , intentResolution ) ;
38
39
let intentResultPromise = control . getIntentResult ( intentResolution ) ;
@@ -56,7 +57,8 @@ export default () =>
56
57
const RaiseIntentContextResult5secs = "(2.0-RaiseIntentContextResult5secs) IntentResult resolves to testContextY instance after a 5 second delay" ;
57
58
it ( RaiseIntentContextResult5secs , async ( ) => {
58
59
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.
60
62
const intentResolution = await control . raiseIntent ( Intent . sharedTestingIntent1 , ContextType . testContextY , undefined , 5000 ) ;
61
63
control . validateIntentResolution ( IntentApp . IntentAppB , intentResolution ) ;
62
64
const intentResultPromise = control . getIntentResult ( intentResolution ) ;
@@ -71,7 +73,8 @@ export default () =>
71
73
const RaiseIntentChannelResult = "(2.0-RaiseIntentChannelResult) IntentResult resolves to a Channel object" ;
72
74
it ( RaiseIntentChannelResult , async ( ) => {
73
75
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.
75
78
const intentResolution = await control . raiseIntent ( Intent . sharedTestingIntent2 , ContextType . testContextY , {
76
79
appId : IntentApp . IntentAppE ,
77
80
} ) ;
@@ -89,6 +92,7 @@ export default () =>
89
92
it ( RaiseIntentPrivateChannelResult , async ( ) => {
90
93
errorListener = await control . listenForError ( ) ;
91
94
let receiver = control . receiveContext ( ControlContextType . sharedTestingIntent2ResultSent , constants . WaitTime ) ;
95
+ await wait ( 300 ) // Added due to nested promise await race condition first observed by Jupnit.
92
96
const intentResolution = await control . raiseIntent ( Intent . sharedTestingIntent2 , ContextType . testContextY , {
93
97
appId : IntentApp . IntentAppF ,
94
98
} ) ;
@@ -105,7 +109,8 @@ export default () =>
105
109
const RaiseIntentVoidResult61secs = "(2.0-RaiseIntentVoidResult61secs) App A receives a void IntentResult after a 61 second delay" ;
106
110
it ( RaiseIntentVoidResult61secs , async ( ) => {
107
111
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.
109
114
const intentResolution = await control . raiseIntent ( Intent . aTestingIntent , ContextType . testContextX , undefined , 61000 ) ;
110
115
control . validateIntentResolution ( IntentApp . IntentAppA , intentResolution ) ;
111
116
let intentResultPromise = control . getIntentResult ( intentResolution ) ;
@@ -120,7 +125,8 @@ export default () =>
120
125
const RaiseIntentContextResult61secs = "(2.0-RaiseIntentContextResult61secs) IntentResult resolves to testContextY instance after a 61 second delay" ;
121
126
it ( RaiseIntentContextResult61secs , async ( ) => {
122
127
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.
124
130
const intentResolution = await control . raiseIntent ( Intent . sharedTestingIntent1 , ContextType . testContextY , undefined , 61000 ) ;
125
131
control . validateIntentResolution ( IntentApp . IntentAppB , intentResolution ) ;
126
132
let intentResultPromise = control . getIntentResult ( intentResolution ) ;
0 commit comments