Author: arp Date: Wed Mar 12 23:26:52 2014 New Revision: 1577002 URL: http://svn.apache.org/r1577002 Log: HDFS-6096. Merging r1577000 from branch-2 to branch-2.4.
Modified: hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTokens.java Modified: hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1577002&r1=1577001&r2=1577002&view=diff ============================================================================== --- hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original) +++ hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Wed Mar 12 23:26:52 2014 @@ -346,6 +346,8 @@ Release 2.4.0 - UNRELEASED HDFS-5705. TestSecondaryNameNodeUpgrade#testChangeNsIDFails may fail due to ConcurrentModificationException. (Ted Yu via brandonli) + HDFS-6096. TestWebHdfsTokens may timeout. (szetszwo via Arpit Agarwal) + BREAKDOWN OF HDFS-5698 SUBTASKS AND RELATED JIRAS HDFS-5717. Save FSImage header in protobuf. (Haohui Mai via jing9) Modified: hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTokens.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTokens.java?rev=1577002&r1=1577001&r2=1577002&view=diff ============================================================================== --- hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTokens.java (original) +++ hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTokens.java Wed Mar 12 23:26:52 2014 @@ -33,7 +33,6 @@ import java.io.IOException; import java.net.URI; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier; import org.apache.hadoop.hdfs.web.resources.DeleteOpParam; import org.apache.hadoop.hdfs.web.resources.GetOpParam; import org.apache.hadoop.hdfs.web.resources.HttpOpParam; @@ -64,11 +63,10 @@ public class TestWebHdfsTokens { return fs; } - @SuppressWarnings("unchecked") - @Test(timeout = 1000) + @Test(timeout = 5000) public void testTokenForNonTokenOp() throws IOException { WebHdfsFileSystem fs = spyWebhdfsInSecureSetup(); - Token<DelegationTokenIdentifier> token = mock(Token.class); + Token<?> token = mock(Token.class); doReturn(token).when(fs).getDelegationToken(null); // should get/set/renew token @@ -85,22 +83,21 @@ public class TestWebHdfsTokens { verify(fs, never()).setDelegationToken(token); } - @Test(timeout = 1000) + @Test(timeout = 5000) public void testNoTokenForGetToken() throws IOException { checkNoTokenForOperation(GetOpParam.Op.GETDELEGATIONTOKEN); } - @Test(timeout = 1000) + @Test(timeout = 5000) public void testNoTokenForCanclToken() throws IOException { checkNoTokenForOperation(PutOpParam.Op.RENEWDELEGATIONTOKEN); } - @Test(timeout = 1000) + @Test(timeout = 5000) public void testNoTokenForCancelToken() throws IOException { checkNoTokenForOperation(PutOpParam.Op.CANCELDELEGATIONTOKEN); } - @SuppressWarnings("unchecked") private void checkNoTokenForOperation(HttpOpParam.Op op) throws IOException { WebHdfsFileSystem fs = spyWebhdfsInSecureSetup(); doReturn(null).when(fs).getDelegationToken(null); @@ -110,7 +107,7 @@ public class TestWebHdfsTokens { fs.toUrl(op, null); verify(fs, never()).getDelegationToken(); verify(fs, never()).getDelegationToken(null); - verify(fs, never()).setDelegationToken(any(Token.class)); + verify(fs, never()).setDelegationToken((Token<?>)any(Token.class)); } @Test(timeout = 1000)