HDFS-16913. Fix flaky some unit tests since they offen timeout (#5377)

Co-authored-by: gf13871 <gf13871@ly.com>
Reviewed-by: Tao Li <tomscut@apache.org>
Reviewed-by: Shilun Fan <slfan1989@apache.org>
Signed-off-by: Shilun Fan <slfan1989@apache.org>
This commit is contained in:
GuoPhilipse 2023-02-14 15:29:38 +08:00 committed by GitHub
parent 1def35d802
commit fe0541b58d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View File

@ -32,7 +32,7 @@ public class TestFileLengthOnClusterRestart {
* Tests the fileLength when we sync the file and restart the cluster and * Tests the fileLength when we sync the file and restart the cluster and
* Datanodes not report to Namenode yet. * Datanodes not report to Namenode yet.
*/ */
@Test(timeout = 60000) @Test(timeout = 120000)
public void testFileLengthWithHSyncAndClusterRestartWithOutDNsRegister() public void testFileLengthWithHSyncAndClusterRestartWithOutDNsRegister()
throws Exception { throws Exception {
final Configuration conf = new HdfsConfiguration(); final Configuration conf = new HdfsConfiguration();

View File

@ -493,17 +493,17 @@ public void testSoftLeaseRecovery() throws Exception {
* *
* @throws Exception * @throws Exception
*/ */
@Test(timeout = 30000) @Test(timeout = 60000)
public void testHardLeaseRecoveryAfterNameNodeRestart() throws Exception { public void testHardLeaseRecoveryAfterNameNodeRestart() throws Exception {
hardLeaseRecoveryRestartHelper(false, -1); hardLeaseRecoveryRestartHelper(false, -1);
} }
@Test(timeout = 30000) @Test(timeout = 60000)
public void testHardLeaseRecoveryAfterNameNodeRestart2() throws Exception { public void testHardLeaseRecoveryAfterNameNodeRestart2() throws Exception {
hardLeaseRecoveryRestartHelper(false, 1535); hardLeaseRecoveryRestartHelper(false, 1535);
} }
@Test(timeout = 30000) @Test(timeout = 60000)
public void testHardLeaseRecoveryWithRenameAfterNameNodeRestart() public void testHardLeaseRecoveryWithRenameAfterNameNodeRestart()
throws Exception { throws Exception {
hardLeaseRecoveryRestartHelper(true, -1); hardLeaseRecoveryRestartHelper(true, -1);

View File

@ -168,7 +168,7 @@ public void testBalancerServiceBalanceTwice() throws Exception {
} }
} }
@Test(timeout = 60000) @Test(timeout = 120000)
public void testBalancerServiceOnError() throws Exception { public void testBalancerServiceOnError() throws Exception {
Configuration conf = new HdfsConfiguration(); Configuration conf = new HdfsConfiguration();
// retry for every 5 seconds // retry for every 5 seconds

View File

@ -210,7 +210,7 @@ public void testWriteOverGracefulFailoverWithDnFail() throws Exception {
doTestWriteOverFailoverWithDnFail(TestScenario.GRACEFUL_FAILOVER); doTestWriteOverFailoverWithDnFail(TestScenario.GRACEFUL_FAILOVER);
} }
@Test(timeout=30000) @Test(timeout=60000)
public void testWriteOverCrashFailoverWithDnFail() throws Exception { public void testWriteOverCrashFailoverWithDnFail() throws Exception {
doTestWriteOverFailoverWithDnFail(TestScenario.ORIGINAL_ACTIVE_CRASHED); doTestWriteOverFailoverWithDnFail(TestScenario.ORIGINAL_ACTIVE_CRASHED);
} }

View File

@ -548,7 +548,7 @@ public void testSnapshotOpsOnReservedPath() throws Exception {
* paths work and the NN can load the resulting edits. This test if for * paths work and the NN can load the resulting edits. This test if for
* snapshots at the root level. * snapshots at the root level.
*/ */
@Test(timeout = 60000) @Test(timeout = 120000)
public void testSnapshotOpsOnRootReservedPath() throws Exception { public void testSnapshotOpsOnRootReservedPath() throws Exception {
Path dir = new Path("/"); Path dir = new Path("/");
Path sub = new Path(dir, "sub"); Path sub = new Path(dir, "sub");