Skip to content

Commit faf9a0c

Browse files
authored
HDFS-17830. Fix failing TestZKDelegationTokenSecretManagerImpl due to static Curator reuse. (#7960) Contributed by Hualong Zhang.
* HDFS-17830. Fix failing TestZKDelegationTokenSecretManagerImpl due to static Curator reuse. Signed-off-by: Shilun Fan <[email protected]>
1 parent 2d2d976 commit faf9a0c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/security/token/TestZKDelegationTokenSecretManagerImpl.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@
3232
import org.apache.hadoop.security.token.SecretManager;
3333
import org.apache.hadoop.security.token.Token;
3434
import org.apache.hadoop.security.token.delegation.TestZKDelegationTokenSecretManager;
35+
import org.apache.hadoop.security.token.delegation.ZKDelegationTokenSecretManager;
3536
import org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier;
3637
import org.apache.hadoop.security.token.delegation.web.DelegationTokenManager;
3738
import org.apache.hadoop.util.Time;
39+
import org.junit.jupiter.api.AfterEach;
3840
import org.junit.jupiter.api.Test;
3941
import org.slf4j.Logger;
4042
import org.slf4j.LoggerFactory;
@@ -44,6 +46,14 @@ public class TestZKDelegationTokenSecretManagerImpl
4446
private static final Logger LOG =
4547
LoggerFactory.getLogger(TestZKDelegationTokenSecretManagerImpl.class);
4648

49+
@Override
50+
@AfterEach
51+
public void tearDown() throws Exception {
52+
super.tearDown();
53+
// Prevent a STOPPED Curator from leaking into the next test.
54+
ZKDelegationTokenSecretManager.setCurator(null);
55+
}
56+
4757
@SuppressWarnings("unchecked")
4858
@Test
4959
public void testMultiNodeOperationWithoutWatch() throws Exception {

0 commit comments

Comments
 (0)