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