Skip to content

Commit d1fd1c1

Browse files
aswinmprabhuAswin M Prabhu
authored andcommitted
Fix unit tests
1 parent 0636bc4 commit d1fd1c1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/qjournal/server/TestJournalNodeSync.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ public void testSyncDuringRollingUpgrade() throws Exception {
480480
}
481481
}
482482

483-
@Test(timeout=900_000)
483+
@Test(timeout=300_000)
484484
public void testFormatWithSyncer() throws Exception {
485485
File firstJournalDir = jCluster.getJournalDir(0, jid);
486486
File firstJournalCurrentDir = new StorageDirectory(firstJournalDir)
@@ -493,17 +493,18 @@ public void testFormatWithSyncer() throws Exception {
493493
List<File> missingLogs = Lists.newArrayList();
494494
missingLogs.add(deleteEditLog(firstJournalCurrentDir, firstTxId));
495495

496-
// Delete the storage directory itself to simulate a disk wipe
496+
// Wait to ensure sync starts, delete the storage directory itself to simulate a disk wipe
497497
// and ensure that the in-memory formatting state of JNStorage gets updated
498+
Thread.sleep(2000);
498499
FileUtils.deleteDirectory(firstJournalDir);
499500
jCluster.getJournalNode(0).getOrCreateJournal(jid).getStorage().analyzeStorage();
500501

501502
// Wait for JN formatting with Syncer
502-
GenericTestUtils.waitFor(jnFormatted(0), 500, 90000);
503+
GenericTestUtils.waitFor(jnFormatted(0), 500, 30000);
503504
// Generate some more edit log so that the JN updates its committed tx id
504505
generateEditLog();
505506
// Check that the missing edit logs have been synced
506-
GenericTestUtils.waitFor(editLogExists(missingLogs), 500, 90000);
507+
GenericTestUtils.waitFor(editLogExists(missingLogs), 500, 30000);
507508
}
508509

509510
private File deleteEditLog(File currentDir, long startTxId)

0 commit comments

Comments
 (0)