@@ -74,15 +74,15 @@ public void testGitHubRateLimit() throws Exception {
74
74
GHRateLimit headerRateLimit = rateLimit ;
75
75
76
76
// Give this a moment
77
- Thread .sleep (1000 );
77
+ Thread .sleep (1500 );
78
78
79
79
// ratelimit() uses headerRateLimit if available and headerRateLimit is not expired
80
80
assertThat (gitHub .rateLimit (), equalTo (headerRateLimit ));
81
81
82
82
assertThat (mockGitHub .getRequestCount (), equalTo (1 ));
83
83
84
84
// Give this a moment
85
- Thread .sleep (1000 );
85
+ Thread .sleep (1500 );
86
86
87
87
// Always requests new info
88
88
rateLimit = gitHub .getRateLimit ();
@@ -96,7 +96,7 @@ public void testGitHubRateLimit() throws Exception {
96
96
previousLimit = rateLimit ;
97
97
98
98
// Give this a moment
99
- Thread .sleep (1000 );
99
+ Thread .sleep (1500 );
100
100
101
101
// Always requests new info
102
102
rateLimit = gitHub .getRateLimit ();
@@ -200,7 +200,7 @@ public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception {
200
200
Date lastReset = new Date (System .currentTimeMillis () / 1000L );
201
201
202
202
// Give this a moment
203
- Thread .sleep (1000 );
203
+ Thread .sleep (1500 );
204
204
205
205
// -------------------------------------------------------------
206
206
// Before any queries, rate limit starts as null but may be requested
@@ -224,7 +224,7 @@ public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception {
224
224
assertThat (mockGitHub .getRequestCount (), equalTo (1 ));
225
225
226
226
// Give this a moment
227
- Thread .sleep (1000 );
227
+ Thread .sleep (1500 );
228
228
229
229
// -------------------------------------------------------------
230
230
// First call to /user gets response without rate limit information
@@ -244,7 +244,7 @@ public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception {
244
244
assertThat (mockGitHub .getRequestCount (), equalTo (3 ));
245
245
246
246
// Give this a moment
247
- Thread .sleep (1000 );
247
+ Thread .sleep (1500 );
248
248
249
249
// Always requests new info
250
250
rateLimit = gitHub .getRateLimit ();
@@ -256,13 +256,13 @@ public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception {
256
256
assertThat (rateLimit .getResetDate ().compareTo (lastReset ), equalTo (1 ));
257
257
258
258
// Give this a moment
259
- Thread .sleep (1000 );
259
+ Thread .sleep (1500 );
260
260
261
261
// last is still null, because it actually means lastHeaderRateLimit
262
262
assertThat (gitHub .lastRateLimit (), CoreMatchers .nullValue ());
263
263
264
264
// ratelimit() tries not to make additional requests, uses queried rate limit since header not available
265
- Thread .sleep (1000 );
265
+ Thread .sleep (1500 );
266
266
assertThat (gitHub .rateLimit (), sameInstance (rateLimit ));
267
267
268
268
// -------------------------------------------------------------
@@ -283,15 +283,15 @@ public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception {
283
283
GHRateLimit headerRateLimit = rateLimit ;
284
284
285
285
// Give this a moment
286
- Thread .sleep (1000 );
286
+ Thread .sleep (1500 );
287
287
288
288
// ratelimit() uses headerRateLimit if available and headerRateLimit is not expired
289
289
assertThat (gitHub .rateLimit (), sameInstance (headerRateLimit ));
290
290
291
291
assertThat (mockGitHub .getRequestCount (), equalTo (5 ));
292
292
293
293
// Give this a moment
294
- Thread .sleep (1000 );
294
+ Thread .sleep (1500 );
295
295
296
296
// Always requests new info
297
297
rateLimit = gitHub .getRateLimit ();
@@ -308,7 +308,7 @@ public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception {
308
308
assertThat (mockGitHub .getRequestCount (), equalTo (6 ));
309
309
310
310
// Wait for the header
311
- Thread .sleep (1000 );
311
+ Thread .sleep (1500 );
312
312
}
313
313
314
314
@ Test
@@ -361,7 +361,7 @@ private void executeExpirationTest() throws Exception {
361
361
GHRateLimit headerRateLimit = null ;
362
362
363
363
// Give this a moment
364
- Thread .sleep (1000 );
364
+ Thread .sleep (1500 );
365
365
366
366
// -------------------------------------------------------------
367
367
// /user gets response with rate limit information
@@ -380,7 +380,7 @@ private void executeExpirationTest() throws Exception {
380
380
sameInstance (headerRateLimit ));
381
381
382
382
// Nothing changes still valid
383
- Thread .sleep (1000 );
383
+ Thread .sleep (1500 );
384
384
385
385
assertThat ("rateLimit() selects header instance when not expired, does not ask server" ,
386
386
gitHub .rateLimit (),
@@ -392,7 +392,7 @@ private void executeExpirationTest() throws Exception {
392
392
assertThat (mockGitHub .getRequestCount (), equalTo (1 ));
393
393
394
394
// This time, rateLimit() should find an expired record and get a new one.
395
- Thread .sleep (3000 );
395
+ Thread .sleep (2500 );
396
396
397
397
assertThat ("Header instance has expired" , gitHub .lastRateLimit ().isExpired (), is (true ));
398
398
0 commit comments