You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2024/05/04 07:49:00 UTC

[jira] [Updated] (YARN-11695) Fixed non-idempotent tests in `TestTaskRunner`

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

ASF GitHub Bot updated YARN-11695:
----------------------------------
    Labels: pull-request-available  (was: )

> 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
>            Priority: Major
>              Labels: pull-request-available
>
> 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-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org