You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2020/06/19 08:48:27 UTC
[flink] branch master updated: [FLINK-18368][tests] Cleanup
Kerberos settings after test.
This is an automated email from the ASF dual-hosted git repository.
sewen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new c8e9d0d [FLINK-18368][tests] Cleanup Kerberos settings after test.
c8e9d0d is described below
commit c8e9d0da032f2d7dd094096d606ab6cc3e368b19
Author: Stephan Ewen <se...@apache.org>
AuthorDate: Thu Jun 18 17:55:06 2020 +0200
[FLINK-18368][tests] Cleanup Kerberos settings after test.
That way successive unit tests that reuse the JVM will not suffer from an
incompatible initial configuration.
---
.../test/java/org/apache/flink/runtime/util/HadoopUtilsTest.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/flink-filesystems/flink-hadoop-fs/src/test/java/org/apache/flink/runtime/util/HadoopUtilsTest.java b/flink-filesystems/flink-hadoop-fs/src/test/java/org/apache/flink/runtime/util/HadoopUtilsTest.java
index 472a4ff..5807018 100644
--- a/flink-filesystems/flink-hadoop-fs/src/test/java/org/apache/flink/runtime/util/HadoopUtilsTest.java
+++ b/flink-filesystems/flink-hadoop-fs/src/test/java/org/apache/flink/runtime/util/HadoopUtilsTest.java
@@ -25,6 +25,7 @@ import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifie
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod;
import org.apache.hadoop.security.token.Token;
+import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mockito;
@@ -49,6 +50,11 @@ public class HadoopUtilsTest extends TestLogger {
sun.security.krb5.Config.refresh();
}
+ @AfterClass
+ public static void cleanupHadoopConfigs() throws KrbException {
+ UserGroupInformation.setConfiguration(new Configuration());
+ }
+
@Test
public void testShouldReturnFalseWhenNoKerberosCredentialsOrDelegationTokens() {
UserGroupInformation.setConfiguration(getHadoopConfigWithAuthMethod(AuthenticationMethod.KERBEROS));