lzx404243 opened a new pull request #2500:
URL: https://github.com/apache/hadoop/pull/2500


   The test 
`org.apache.hadoop.mapred.TestTaskProgressReporter.testBytesWrittenRespectingLimit`
 is not idempotent and fails if run twice in the same JVM, because it pollutes 
state shared among tests. It may be good to clean this state pollution so that 
some other tests do not fail in the future due to the shared state polluted by 
this test.
   
   Details
   ---
   Running `TestTaskProgressReporter.testBytesWrittenRespectingLimit` twice 
would result in the second run failing with the following assertion:
   ```
   Assert.assertEquals(failFast, threadExited)
   ```
   The root cause for this is that when`testBytesWrittenRespectingLimit` writes 
some bytes on the local file system, some counters are being incremented. The 
problem is that, after the test is done, the counter is not reset. With this 
polluted shared state, assumptions are broken, resulting in test failure in the 
second run.
   
   The fix is to invoke `FileSystem.clearStatistics()` to reset the 
counter(among others statistics) when the test finishes.
   
   With the proposed fix, the test does not pollute the shared state (and 
passes when run twice in the same JVM).
   
   Jira link: 
[MAPREDUCE-7311](https://issues.apache.org/jira/browse/MAPREDUCE-7311)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to