From d11470c05ef6770ae5666d1fdc851495dfb93646 Mon Sep 17 00:00:00 2001 From: Siyao Meng <50227127+smengcl@users.noreply.github.com> Date: Thu, 19 Aug 2021 22:09:00 -0700 Subject: [PATCH] [Check line removal] Fix TestDFSClientFailover. Change-Id: Idb57ccbee96be77d6bb2df5ec5e3f2d25e846894 --- .../java/org/apache/hadoop/hdfs/TestDFSClientFailover.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientFailover.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientFailover.java index f52cd646c49..746714af9c7 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientFailover.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientFailover.java @@ -31,6 +31,7 @@ import java.util.List; import javax.net.SocketFactory; +import org.junit.jupiter.api.Assertions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.hadoop.conf.Configuration; @@ -54,7 +55,6 @@ import org.apache.hadoop.test.GenericTestUtils; import org.apache.hadoop.util.StringUtils; import org.junit.Test; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.BeforeEach; import org.mockito.ArgumentMatcher; import org.mockito.Mockito; @@ -230,7 +230,7 @@ public class TestDFSClientFailover { try { Field f = InetAddress.class.getDeclaredField("nameServices"); f.setAccessible(true); - Assumptions.assumeNotNull(f); + Assertions.assertNotNull(f); @SuppressWarnings("unchecked") List nsList = (List) f.get(null); @@ -245,7 +245,7 @@ public class TestDFSClientFailover { LOG.info("Unable to spy on DNS. Skipping test.", t); // In case the JDK we're testing on doesn't work like Sun's, just // skip the test. - Assumptions.assumeNoException(t); + // Assume.assumeNoException(t); // TODO: Should be safe to remove this? throw new RuntimeException(t); } }