Kaiyao Ke created YARN-11695:
--------------------------------

             Summary: Fixed non-idempotent tests in `TestTaskRunner`
                 Key: YARN-11695
                 URL: https://issues.apache.org/jira/browse/YARN-11695
             Project: Hadoop YARN
          Issue Type: Bug
            Reporter: Kaiyao Ke


All tests in `org.apache.hadoop.yarn.sls.scheduler.TestTaskRunner` are not 
idempotent and fails upon repeated execution within the same JVM instance due 
to self-induced state pollution. Specifically, the test runs made changes to 
the static fields (e.g. `PreStartTask.first` in the task classes without 
restoring them. Therefore, repeated runs throw assertion errors.

Sample error message of `TestTaskRunner#testPreStartQueueing` in repeated test 
run:
```
java.lang.AssertionError:
        at org.junit.Assert.fail(Assert.java:87)
        at org.junit.Assert.assertTrue(Assert.java:42)
        at org.junit.Assert.assertTrue(Assert.java:53)
        at 
org.apache.hadoop.yarn.sls.scheduler.TestTaskRunner.testPreStartQueueing(TestTaskRunner.java:244)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
``` 
The fix is done by explicitly setting (resetting) the static variables 
(countdown latches and booleans) at the start of each test.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to