[ 
https://issues.apache.org/jira/browse/MAPREDUCE-7361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yang Chen updated MAPREDUCE-7361:
---------------------------------
    Description: 
h2. What is the purpose of this change

This PR is to clean the polluted shared status among the 3 tests:
 
{code:java}
Test1: 
org.apache.hadoop.mapred.TestTaskProgressReporter.testBytesWrittenRespectingLimit
  Test2: org.apache.hadoop.mapred.TestTaskProgressReporter.testScratchDirSize 
Test3: org.apache.hadoop.mapred.TestTaskProgressReporter.testTaskProgress{code}
{{}}
Test1 and Test2 pollute the shared status with Test3, which can make test3 fail.
h2. Reproduce the test failures

Run the tests in the same JVM in the following orders:
 * Test1 and Test3
 * Test2 and Test3

h2. Expected result

The tests should run successfully when multiple tests that use this shared 
state are run in the same JVM.
h2. Actual result
 * Run Test1 and Test3, Test3 fails:

{code:java}
 [ERROR] TestTaskProgressReporter.testTaskProgress:267 expected:<[2]> but 
was:<[3]>{code}
{{}} * Run Test2 and Test3, Test3 fails:

{code:java}
 [ERROR] TestTaskProgressReporter.testTaskProgress:267 expected:<[2]> but 
was:<[11]>{code}
{{}}
h2. Fix

Clean the value of {{statusUpdateTimes}} to 0 at the start of Test3(the victim) 
to clean the pollution from Test1 and Test2(the polluters).

  was:
h2. What is the purpose of this change

This PR is to fix a non-idempotent test 
{code:java}
org.apache.hadoop.mapred.TestTaskProgressReporter.testTaskProgress{code}
h2. Why the test failed

The root cause for the failure is that this test does not reset 
{{statusUpdateTimes}} at the end, which pollutes the shared state. It may be 
better to clean state pollutions so that some other tests won't fail in the 
future due to the shared state polluted by this test.
h2. Reproduce test failure

Run the test twice in the same JVM.
h2. Expected result

The test should pass without any failure 2 times.
h2. Actual result

Get failures:
{code:java}
[ERROR] Failures:  
[ERROR] TestTaskProgressReporter.testTaskProgress:267 expected:<[2]> but 
was:<[4]>{code}
h2. Fix

Reset the value of {{statusUpdateTimes}} to 0 at the end of the test.


> Clean shared state pollution to avoid flaky tests
> -------------------------------------------------
>
>                 Key: MAPREDUCE-7361
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-7361
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>            Reporter: Yang Chen
>            Priority: Minor
>
> h2. What is the purpose of this change
> This PR is to clean the polluted shared status among the 3 tests:
>  
> {code:java}
> Test1: 
> org.apache.hadoop.mapred.TestTaskProgressReporter.testBytesWrittenRespectingLimit
>   Test2: org.apache.hadoop.mapred.TestTaskProgressReporter.testScratchDirSize 
> Test3: 
> org.apache.hadoop.mapred.TestTaskProgressReporter.testTaskProgress{code}
> {{}}
> Test1 and Test2 pollute the shared status with Test3, which can make test3 
> fail.
> h2. Reproduce the test failures
> Run the tests in the same JVM in the following orders:
>  * Test1 and Test3
>  * Test2 and Test3
> h2. Expected result
> The tests should run successfully when multiple tests that use this shared 
> state are run in the same JVM.
> h2. Actual result
>  * Run Test1 and Test3, Test3 fails:
> {code:java}
>  [ERROR] TestTaskProgressReporter.testTaskProgress:267 expected:<[2]> but 
> was:<[3]>{code}
> {{}} * Run Test2 and Test3, Test3 fails:
> {code:java}
>  [ERROR] TestTaskProgressReporter.testTaskProgress:267 expected:<[2]> but 
> was:<[11]>{code}
> {{}}
> h2. Fix
> Clean the value of {{statusUpdateTimes}} to 0 at the start of Test3(the 
> victim) to clean the pollution from Test1 and Test2(the polluters).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: mapreduce-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: mapreduce-issues-h...@hadoop.apache.org

Reply via email to