From 5c94c27cbc28ed8863420b0d08af4d6d7468998c Mon Sep 17 00:00:00 2001 From: James Turton <9107319+jnturton@users.noreply.github.com> Date: Wed, 16 Aug 2023 20:01:55 +0200 Subject: [PATCH] [MINOR UPDATE]: Fix Hadoop 3 impersonation test errors during CI runs (#2822) * Shut down MiniDFS cluster in TestInboundImpersonation.selectChainedView. * Ensure that MiniDFS is using simple auth in BaseTestImpersonation. --- .../drill/exec/impersonation/BaseTestImpersonation.java | 7 +++++++ .../drill/exec/impersonation/TestInboundImpersonation.java | 2 ++ 2 files changed, 9 insertions(+) diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/impersonation/BaseTestImpersonation.java b/exec/java-exec/src/test/java/org/apache/drill/exec/impersonation/BaseTestImpersonation.java index f1d471d09e6..37ae508c37c 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/impersonation/BaseTestImpersonation.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/impersonation/BaseTestImpersonation.java @@ -103,6 +103,13 @@ protected static void startMiniDfsCluster(String testClass, boolean isImpersonat // Set the proxyuser settings so that the user who is running the Drillbits/MiniDfs can impersonate other users. dfsConf.set(String.format("hadoop.proxyuser.%s.hosts", processUser), "*"); dfsConf.set(String.format("hadoop.proxyuser.%s.groups", processUser), "*"); + + // It isn't clear exactly when or why the following reinitialisation is + // needed, but without it the test subclasses of this class may crash + // when run in the GitHub CI with Mini DFS stating "Running in secure + // mode, but config doesn't have a keytab". + dfsConf.set("hadoop.security.authentication", "simple"); + UserGroupInformation.setConfiguration(dfsConf); } // Start the MiniDfs cluster diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/impersonation/TestInboundImpersonation.java b/exec/java-exec/src/test/java/org/apache/drill/exec/impersonation/TestInboundImpersonation.java index 18b1684a93a..3a2bc8e9077 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/impersonation/TestInboundImpersonation.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/impersonation/TestInboundImpersonation.java @@ -92,6 +92,8 @@ public void selectChainedView() throws Exception { .go(); } adminClient.resetSystem(ExecConstants.IMPERSONATION_POLICIES_KEY); + } finally { + stopMiniDfsCluster(); } }