@@ -71,7 +71,7 @@ public void StatusCode204StopsLongPollingTriggersOnClosed() {
71
71
72
72
assertFalse (onClosedRan .get ());
73
73
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
74
- assertTrue (block .blockingAwait (1 , TimeUnit .SECONDS ));
74
+ assertTrue (block .blockingAwait (30 , TimeUnit .SECONDS ));
75
75
assertTrue (onClosedRan .get ());
76
76
assertFalse (transport .isActive ());
77
77
}
@@ -100,7 +100,7 @@ public void LongPollingFailsWhenReceivingUnexpectedErrorCode() {
100
100
});
101
101
102
102
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
103
- assertTrue (blocker .blockingAwait (1 , TimeUnit .SECONDS ));
103
+ assertTrue (blocker .blockingAwait (30 , TimeUnit .SECONDS ));
104
104
assertFalse (transport .isActive ());
105
105
assertTrue (onClosedRan .get ());
106
106
}
@@ -126,7 +126,6 @@ public void CanSetAndTriggerOnReceive() {
126
126
assertTrue (onReceivedRan .get ());
127
127
}
128
128
129
- @ Disabled ("https://github.com/dotnet/aspnetcore/issues/34563" )
130
129
@ Test
131
130
public void LongPollingTransportOnReceiveGetsCalled () {
132
131
AtomicInteger requestCount = new AtomicInteger ();
@@ -158,7 +157,7 @@ public void LongPollingTransportOnReceiveGetsCalled() {
158
157
transport .setOnClose ((error ) -> {});
159
158
160
159
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
161
- assertTrue (block .blockingAwait (1 ,TimeUnit .SECONDS ));
160
+ assertTrue (block .blockingAwait (30 ,TimeUnit .SECONDS ));
162
161
assertTrue (onReceiveCalled .get ());
163
162
assertEquals ("TEST" , message .get ());
164
163
}
@@ -203,7 +202,7 @@ public void LongPollingTransportOnReceiveGetsCalledMultipleTimes() {
203
202
transport .setOnClose ((error ) -> {});
204
203
205
204
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
206
- assertTrue (blocker .blockingAwait (1 , TimeUnit .SECONDS ));
205
+ assertTrue (blocker .blockingAwait (30 , TimeUnit .SECONDS ));
207
206
assertTrue (onReceiveCalled .get ());
208
207
assertEquals ("FIRSTSECONDTHIRD" , message .get ());
209
208
}
@@ -219,7 +218,7 @@ public void LongPollingTransportSendsHeaders() {
219
218
requestCount .incrementAndGet ();
220
219
return Single .just (new HttpResponse (200 , "" , TestUtils .emptyByteBuffer ));
221
220
}
222
- assertTrue (close .blockingAwait (1 , TimeUnit .SECONDS ));
221
+ assertTrue (close .blockingAwait (30 , TimeUnit .SECONDS ));
223
222
return Single .just (new HttpResponse (204 , "" , TestUtils .emptyByteBuffer ));
224
223
}).on ("POST" , (req ) -> {
225
224
assertFalse (req .getHeaders ().isEmpty ());
@@ -234,7 +233,7 @@ public void LongPollingTransportSendsHeaders() {
234
233
235
234
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
236
235
ByteBuffer sendBuffer = TestUtils .stringToByteBuffer ("TEST" );
237
- assertTrue (transport .send (sendBuffer ).blockingAwait (1 , TimeUnit .SECONDS ));
236
+ assertTrue (transport .send (sendBuffer ).blockingAwait (30 , TimeUnit .SECONDS ));
238
237
close .onComplete ();
239
238
assertEquals (headerValue .get (), "VALUE" );
240
239
}
@@ -250,7 +249,7 @@ public void LongPollingTransportSetsAuthorizationHeader() {
250
249
requestCount .incrementAndGet ();
251
250
return Single .just (new HttpResponse (200 , "" , TestUtils .emptyByteBuffer ));
252
251
}
253
- assertTrue (close .blockingAwait (1 , TimeUnit .SECONDS ));
252
+ assertTrue (close .blockingAwait (30 , TimeUnit .SECONDS ));
254
253
return Single .just (new HttpResponse (204 , "" , TestUtils .emptyByteBuffer ));
255
254
})
256
255
.on ("POST" , (req ) -> {
@@ -266,7 +265,7 @@ public void LongPollingTransportSetsAuthorizationHeader() {
266
265
267
266
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
268
267
ByteBuffer sendBuffer = TestUtils .stringToByteBuffer ("TEST" );
269
- assertTrue (transport .send (sendBuffer ).blockingAwait (1 , TimeUnit .SECONDS ));
268
+ assertTrue (transport .send (sendBuffer ).blockingAwait (30 , TimeUnit .SECONDS ));
270
269
assertEquals (headerValue .get (), "Bearer TOKEN" );
271
270
close .onComplete ();
272
271
}
@@ -285,7 +284,7 @@ public void LongPollingTransportRunsAccessTokenProviderEveryRequest() {
285
284
}
286
285
assertEquals ("Bearer TOKEN1" , req .getHeaders ().get ("Authorization" ));
287
286
secondGet .onComplete ();
288
- assertTrue (close .blockingAwait (1 , TimeUnit .SECONDS ));
287
+ assertTrue (close .blockingAwait (30 , TimeUnit .SECONDS ));
289
288
return Single .just (new HttpResponse (204 , "" , TestUtils .emptyByteBuffer ));
290
289
})
291
290
.on ("POST" , (req ) -> {
@@ -301,9 +300,9 @@ public void LongPollingTransportRunsAccessTokenProviderEveryRequest() {
301
300
transport .setOnClose ((error ) -> {});
302
301
303
302
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
304
- secondGet .blockingAwait (1 , TimeUnit .SECONDS );
303
+ secondGet .blockingAwait (30 , TimeUnit .SECONDS );
305
304
ByteBuffer sendBuffer = TestUtils .stringToByteBuffer ("TEST" );
306
- assertTrue (transport .send (sendBuffer ).blockingAwait (1 , TimeUnit .SECONDS ));
305
+ assertTrue (transport .send (sendBuffer ).blockingAwait (30 , TimeUnit .SECONDS ));
307
306
assertEquals ("Bearer TOKEN2" , headerValue .get ());
308
307
close .onComplete ();
309
308
}
@@ -336,12 +335,12 @@ public void After204StopDoesNotTriggerOnCloseAgain() {
336
335
337
336
assertFalse (onClosedRan .get ());
338
337
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
339
- assertTrue (block .blockingAwait (1 , TimeUnit .SECONDS ));
338
+ assertTrue (block .blockingAwait (30 , TimeUnit .SECONDS ));
340
339
assertEquals (1 , onCloseCount .get ());
341
340
assertTrue (onClosedRan .get ());
342
341
assertFalse (transport .isActive ());
343
342
344
- assertTrue (transport .stop ().blockingAwait (1 , TimeUnit .SECONDS ));
343
+ assertTrue (transport .stop ().blockingAwait (30 , TimeUnit .SECONDS ));
345
344
assertEquals (1 , onCloseCount .get ());
346
345
}
347
346
@@ -355,7 +354,7 @@ public void StoppingTransportRunsCloseHandlersOnce() {
355
354
firstPoll .set (false );
356
355
return Single .just (new HttpResponse (200 , "" , TestUtils .emptyByteBuffer ));
357
356
} else {
358
- assertTrue (block .blockingAwait (1 , TimeUnit .SECONDS ));
357
+ assertTrue (block .blockingAwait (30 , TimeUnit .SECONDS ));
359
358
return Single .just (new HttpResponse (204 , "" , TestUtils .emptyByteBuffer ));
360
359
}
361
360
})
@@ -374,7 +373,7 @@ public void StoppingTransportRunsCloseHandlersOnce() {
374
373
375
374
assertEquals (0 , onCloseCount .get ());
376
375
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
377
- assertTrue (transport .stop ().blockingAwait (1 , TimeUnit .SECONDS ));
376
+ assertTrue (transport .stop ().blockingAwait (30 , TimeUnit .SECONDS ));
378
377
assertEquals (1 , onCloseCount .get ());
379
378
assertFalse (transport .isActive ());
380
379
}
0 commit comments