Skip to content

Commit 5098444

Browse files
author
duke
committed
Backport 05ae7ed1aac6fabc9c8820c12b6567fe93a3546f
1 parent ac1f868 commit 5098444

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/jdk/sun/security/krb5/auto/Renew.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -82,7 +82,10 @@ public static void main(String[] args) throws Exception {
8282
Date d1 = c.s().getPrivateCredentials(KerberosTicket.class).iterator().next().getAuthTime();
8383

8484
// 6s is longer than half of 10s
85-
Thread.sleep(6000);
85+
Date expiring = new Date(d1.getTime() + 6000);
86+
while (new Date().before(expiring)) {
87+
Thread.sleep(500);
88+
}
8689

8790
// The second login uses the cache
8891
c = Context.fromJAAS("second");

0 commit comments

Comments
 (0)