@@ -121,6 +121,7 @@ describeRepeats('GapFill with resends', () => {
121121
122122 count += 1
123123 if ( count === 2 ) {
124+ client . debug ( '(%o) << Test Dropped Message %s: %o' , client . connection . getState ( ) , count , msg )
124125 return null
125126 }
126127
@@ -130,7 +131,7 @@ describeRepeats('GapFill with resends', () => {
130131 expect ( subscriber . count ( stream . id ) ) . toBe ( 1 )
131132
132133 const published = await publishTestMessages ( MAX_MESSAGES , {
133- timestamp : 111111 ,
134+ waitForLast : true ,
134135 } )
135136
136137 const received = [ ]
@@ -155,7 +156,8 @@ describeRepeats('GapFill with resends', () => {
155156 }
156157
157158 count += 1
158- if ( count > 1 && count < 5 ) {
159+ if ( count > 1 && count < 4 ) {
160+ client . debug ( '(%o) << Test Dropped Message %s: %o' , client . connection . getState ( ) , count , msg )
159161 return null
160162 }
161163
@@ -164,7 +166,9 @@ describeRepeats('GapFill with resends', () => {
164166
165167 expect ( subscriber . count ( stream . id ) ) . toBe ( 1 )
166168
167- const published = await publishTestMessages ( MAX_MESSAGES )
169+ const published = await publishTestMessages ( MAX_MESSAGES , {
170+ waitForLast : true ,
171+ } )
168172
169173 const received = [ ]
170174 for await ( const m of sub ) {
@@ -175,7 +179,7 @@ describeRepeats('GapFill with resends', () => {
175179 }
176180 expect ( received ) . toEqual ( published )
177181 expect ( client . connection . getState ( ) ) . toBe ( 'connected' )
178- } , 10000 )
182+ } , 20000 )
179183
180184 it ( 'can fill multiple gaps' , async ( ) => {
181185 const sub = await client . subscribe ( stream . id )
@@ -189,6 +193,7 @@ describeRepeats('GapFill with resends', () => {
189193
190194 count += 1
191195 if ( count === 3 || count === 4 || count === 7 ) {
196+ client . debug ( '(%o) << Test Dropped Message %s: %o' , client . connection . getState ( ) , count , msg )
192197 return null
193198 }
194199
@@ -197,7 +202,9 @@ describeRepeats('GapFill with resends', () => {
197202
198203 expect ( subscriber . count ( stream . id ) ) . toBe ( 1 )
199204
200- const published = await publishTestMessages ( MAX_MESSAGES )
205+ const published = await publishTestMessages ( MAX_MESSAGES , {
206+ waitForLast : true ,
207+ } )
201208
202209 const received = [ ]
203210 for await ( const m of sub ) {
@@ -221,14 +228,14 @@ describeRepeats('GapFill with resends', () => {
221228
222229 count += 1
223230 if ( count === 3 || count === 4 || count === 7 ) {
231+ client . debug ( '(%o) << Test Dropped Message %s: %o' , client . connection . getState ( ) , count , msg )
224232 return null
225233 }
226234
227235 return msg
228236 }
229237
230238 const published = await publishTestMessages ( MAX_MESSAGES , {
231- timestamp : 111111 ,
232239 waitForLast : true ,
233240 } )
234241
@@ -260,10 +267,12 @@ describeRepeats('GapFill with resends', () => {
260267 if ( ! droppedMsgRef ) {
261268 droppedMsgRef = msg . streamMessage . getMessageRef ( )
262269 }
270+ client . debug ( '(%o) << Test Dropped Message %s: %o' , client . connection . getState ( ) , count , msg )
263271 return null
264272 }
265273
266274 if ( droppedMsgRef && msg . streamMessage . getMessageRef ( ) . compareTo ( droppedMsgRef ) === 0 ) {
275+ client . debug ( '(%o) << Test Dropped Message %s: %o' , client . connection . getState ( ) , count , msg )
267276 return null
268277 }
269278
0 commit comments