### Question:
ShuffleScheduler { public synchronized void tipFailed(TaskID taskId) { if (!finishedMaps[taskId.getId()]) { finishedMaps[taskId.getId()] = true; if (--remainingMaps == 0) { notifyAll(); } updateStatus(); } } ShuffleScheduler(JobConf job, TaskStatus status,
                          ExceptionReporter reporter,
                          Progress progress,
                          Counters.Counter shuffledMapsCounter,
                          Counters.Counter reduceShuffleBytes,
                          Counters.Counter failedShuffleCounter); synchronized void copySucceeded(TaskAttemptID mapId, 
                                         MapHost host,
                                         long bytes,
                                         long millis,
                                         MapOutput<K,V> output
                                         ); synchronized void copyFailed(TaskAttemptID mapId, MapHost host,
                                      boolean readError, boolean connectExcpt); synchronized void tipFailed(TaskID taskId); synchronized void addKnownMapOutput(String hostName, 
                                             String hostUrl,
                                             TaskAttemptID mapId); synchronized void obsoleteMapOutput(TaskAttemptID mapId); synchronized void putBackKnownMapOutput(MapHost host, 
                                                 TaskAttemptID mapId); synchronized MapHost getHost(); synchronized List<TaskAttemptID> getMapsForHost(MapHost host); synchronized void freeHost(MapHost host); synchronized void resetKnownMaps(); synchronized boolean waitUntilDone(int millis
                                            ); void close(); synchronized void informMaxMapRunTime(int duration);  }### Answer:
@SuppressWarnings("rawtypes") @Test public void testTipFailed() throws Exception { JobConf job = new JobConf(); job.setNumMapTasks(2); TaskStatus status = new TaskStatus() { @Override public boolean getIsMap() { return false; } @Override public void addFetchFailedMap(TaskAttemptID mapTaskId) { } }; Progress progress = new Progress(); ShuffleScheduler scheduler = new ShuffleScheduler(job, status, null, progress, null, null, null); JobID jobId = new JobID(); TaskID taskId1 = new TaskID(jobId, TaskType.REDUCE, 1); scheduler.tipFailed(taskId1); Assert.assertEquals("Progress should be 0.5", 0.5f, progress.getProgress(), 0.0f); Assert.assertFalse(scheduler.waitUntilDone(1)); TaskID taskId0 = new TaskID(jobId, TaskType.REDUCE, 0); scheduler.tipFailed(taskId0); Assert.assertEquals("Progress should be 1.0", 1.0f, progress.getProgress(), 0.0f); Assert.assertTrue(scheduler.waitUntilDone(1)); }