Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ea7a1a7

Browse filesBrowse files
committed
More GHRateLimit test stabilization
1 parent 36b5601 commit ea7a1a7
Copy full SHA for ea7a1a7

File tree

Expand file treeCollapse file tree

1 file changed

+14
-14
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-14
lines changed

‎src/test/java/org/kohsuke/github/GHRateLimitTest.java

Copy file name to clipboardExpand all lines: src/test/java/org/kohsuke/github/GHRateLimitTest.java
+14-14Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ public void testGitHubRateLimit() throws Exception {
7474
GHRateLimit headerRateLimit = rateLimit;
7575

7676
// Give this a moment
77-
Thread.sleep(1000);
77+
Thread.sleep(1500);
7878

7979
// ratelimit() uses headerRateLimit if available and headerRateLimit is not expired
8080
assertThat(gitHub.rateLimit(), equalTo(headerRateLimit));
8181

8282
assertThat(mockGitHub.getRequestCount(), equalTo(1));
8383

8484
// Give this a moment
85-
Thread.sleep(1000);
85+
Thread.sleep(1500);
8686

8787
// Always requests new info
8888
rateLimit = gitHub.getRateLimit();
@@ -96,7 +96,7 @@ public void testGitHubRateLimit() throws Exception {
9696
previousLimit = rateLimit;
9797

9898
// Give this a moment
99-
Thread.sleep(1000);
99+
Thread.sleep(1500);
100100

101101
// Always requests new info
102102
rateLimit = gitHub.getRateLimit();
@@ -200,7 +200,7 @@ public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception {
200200
Date lastReset = new Date(System.currentTimeMillis() / 1000L);
201201

202202
// Give this a moment
203-
Thread.sleep(1000);
203+
Thread.sleep(1500);
204204

205205
// -------------------------------------------------------------
206206
// Before any queries, rate limit starts as null but may be requested
@@ -224,7 +224,7 @@ public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception {
224224
assertThat(mockGitHub.getRequestCount(), equalTo(1));
225225

226226
// Give this a moment
227-
Thread.sleep(1000);
227+
Thread.sleep(1500);
228228

229229
// -------------------------------------------------------------
230230
// First call to /user gets response without rate limit information
@@ -244,7 +244,7 @@ public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception {
244244
assertThat(mockGitHub.getRequestCount(), equalTo(3));
245245

246246
// Give this a moment
247-
Thread.sleep(1000);
247+
Thread.sleep(1500);
248248

249249
// Always requests new info
250250
rateLimit = gitHub.getRateLimit();
@@ -256,13 +256,13 @@ public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception {
256256
assertThat(rateLimit.getResetDate().compareTo(lastReset), equalTo(1));
257257

258258
// Give this a moment
259-
Thread.sleep(1000);
259+
Thread.sleep(1500);
260260

261261
// last is still null, because it actually means lastHeaderRateLimit
262262
assertThat(gitHub.lastRateLimit(), CoreMatchers.nullValue());
263263

264264
// ratelimit() tries not to make additional requests, uses queried rate limit since header not available
265-
Thread.sleep(1000);
265+
Thread.sleep(1500);
266266
assertThat(gitHub.rateLimit(), sameInstance(rateLimit));
267267

268268
// -------------------------------------------------------------
@@ -283,15 +283,15 @@ public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception {
283283
GHRateLimit headerRateLimit = rateLimit;
284284

285285
// Give this a moment
286-
Thread.sleep(1000);
286+
Thread.sleep(1500);
287287

288288
// ratelimit() uses headerRateLimit if available and headerRateLimit is not expired
289289
assertThat(gitHub.rateLimit(), sameInstance(headerRateLimit));
290290

291291
assertThat(mockGitHub.getRequestCount(), equalTo(5));
292292

293293
// Give this a moment
294-
Thread.sleep(1000);
294+
Thread.sleep(1500);
295295

296296
// Always requests new info
297297
rateLimit = gitHub.getRateLimit();
@@ -308,7 +308,7 @@ public void testGitHubEnterpriseDoesNotHaveRateLimit() throws Exception {
308308
assertThat(mockGitHub.getRequestCount(), equalTo(6));
309309

310310
// Wait for the header
311-
Thread.sleep(1000);
311+
Thread.sleep(1500);
312312
}
313313

314314
@Test
@@ -361,7 +361,7 @@ private void executeExpirationTest() throws Exception {
361361
GHRateLimit headerRateLimit = null;
362362

363363
// Give this a moment
364-
Thread.sleep(1000);
364+
Thread.sleep(1500);
365365

366366
// -------------------------------------------------------------
367367
// /user gets response with rate limit information
@@ -380,7 +380,7 @@ private void executeExpirationTest() throws Exception {
380380
sameInstance(headerRateLimit));
381381

382382
// Nothing changes still valid
383-
Thread.sleep(1000);
383+
Thread.sleep(1500);
384384

385385
assertThat("rateLimit() selects header instance when not expired, does not ask server",
386386
gitHub.rateLimit(),
@@ -392,7 +392,7 @@ private void executeExpirationTest() throws Exception {
392392
assertThat(mockGitHub.getRequestCount(), equalTo(1));
393393

394394
// This time, rateLimit() should find an expired record and get a new one.
395-
Thread.sleep(3000);
395+
Thread.sleep(2500);
396396

397397
assertThat("Header instance has expired", gitHub.lastRateLimit().isExpired(), is(true));
398398

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.