You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2018/09/05 01:30:12 UTC
[3/3] kudu git commit: KUDU-2489: Improve runtime of slow java test.
KUDU-2489: Improve runtime of slow java test.
Shortened the kerberos renew lifetime parameter and the
Thread.sleep parameters. These changes cut the test runtime by ~30 seconds.
Change-Id: I19fa5185430a6c91fbe050dbc458b7b91e2d5bea
Reviewed-on: http://gerrit.cloudera.org:8080/11365
Tested-by: Kudu Jenkins
Reviewed-by: Grant Henke <gr...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/224f4792
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/224f4792
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/224f4792
Branch: refs/heads/master
Commit: 224f4792d9d443066be6a4a7f6442211a340c59b
Parents: 459be18
Author: Brian McDevitt <br...@phdata.io>
Authored: Thu Aug 30 16:15:34 2018 -0500
Committer: Grant Henke <gr...@apache.org>
Committed: Wed Sep 5 01:29:43 2018 +0000
----------------------------------------------------------------------
.../src/test/java/org/apache/kudu/client/TestSecurity.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/224f4792/java/kudu-client/src/test/java/org/apache/kudu/client/TestSecurity.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestSecurity.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestSecurity.java
index 0ebcc50..a6d0f95 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestSecurity.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestSecurity.java
@@ -52,7 +52,7 @@ import com.stumbleupon.async.Deferred;
public class TestSecurity {
private static final String TABLE_NAME = "TestSecurity-table";
private static final int TICKET_LIFETIME_SECS = 10;
- private static final int RENEWABLE_LIFETIME_SECS = 30;
+ private static final int RENEWABLE_LIFETIME_SECS = 20;
private final CapturingLogAppender cla = new CapturingLogAppender();
private MiniKuduCluster miniCluster;
@@ -313,7 +313,7 @@ public class TestSecurity {
try (Closeable c = cla.attach()) {
for (Stopwatch sw = Stopwatch.createStarted();
sw.elapsed(TimeUnit.SECONDS) < RENEWABLE_LIFETIME_SECS * 2;) {
- if (timeSinceKinit.elapsed(TimeUnit.SECONDS) > TICKET_LIFETIME_SECS + 5) {
+ if (timeSinceKinit.elapsed(TimeUnit.SECONDS) > TICKET_LIFETIME_SECS + 2) {
// We have gotten past the initial lifetime and well into the renewable
// lifetime. If we haven't failed yet, that means that Kudu
// successfully renewed the ticket.
@@ -324,7 +324,7 @@ public class TestSecurity {
miniCluster.kinit("test-admin");
timeSinceKinit.reset().start();
}
- Thread.sleep(5000);
+ Thread.sleep(1000);
// Ensure that we don't use an authentication token to reconnect.
client.asyncClient.securityContext.setAuthenticationToken(null);
checkClientCanReconnect(client);
@@ -418,6 +418,7 @@ public class TestSecurity {
@Test(timeout=300000)
public void testExternallyProvidedSubjectRefreshedExternally() throws Exception {
startCluster(ImmutableSet.of(Option.SHORT_TOKENS_AND_TICKETS));
+
Subject subject = SecurityUtil.getSubjectFromTicketCacheOrNull();
Assert.assertNotNull(subject);
try (Closeable c = cla.attach()) {
@@ -427,7 +428,7 @@ public class TestSecurity {
// are indeed picking up the new credentials.
for (Stopwatch sw = Stopwatch.createStarted();
sw.elapsed(TimeUnit.SECONDS) < RENEWABLE_LIFETIME_SECS + 5;
- Thread.sleep(3000)) {
+ Thread.sleep(1000)) {
miniCluster.kinit("test-admin");
// Update the existing subject in-place by copying over the credentials from