Skip to content

Commit 0f8e661

Browse files
authored
Merge pull request #29 from jenkinsci/reduce_flakiness
reduce flakiness
2 parents 536b46e + d524acd commit 0f8e661

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/test/java/org/jenkinsci/plugins/kubernetes/credentials/OpenShiftBearerTokenCredentialTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,12 @@ public void testBadLocation() throws IOException {
9696
}
9797

9898
@Test
99-
public void testValidTokenExtraction() throws OpenShiftBearerTokenCredentialImpl.TokenResponseError {
99+
public void testTokenExtractionEarlyExpire() throws OpenShiftBearerTokenCredentialImpl.TokenResponseError {
100100
OpenShiftBearerTokenCredentialImpl.Token token = OpenShiftBearerTokenCredentialImpl.extractTokenFromLocation("https://master.cluster.local:8443/oauth/token/display#access_token=VO4dAgNGLnX5MGYu_wXau8au2Rw0QAqnwq8AtrLkMfU&expires_in=86400&token_type=bearer");
101101
assertEquals("VO4dAgNGLnX5MGYu_wXau8au2Rw0QAqnwq8AtrLkMfU", token.value);
102102

103103
// We are optimistic here and expect the test to run in less than a second.
104-
// TODO: Improve
105-
assertEquals(86100000, token.expire - System.currentTimeMillis());
104+
assertEquals(86400 - OpenShiftBearerTokenCredentialImpl.EARLY_EXPIRE_DELAY_SEC, (token.expire - System.currentTimeMillis())/1000);
106105
}
107106

108107
@Test

0 commit comments

Comments
 (0)