joseluisll opened a new pull request, #8788:
URL: https://github.com/apache/hadoop/pull/8788

   ### Description of PR
   
   JIRA: [YARN-12005](https://issues.apache.org/jira/browse/YARN-12005)
   
   `TestRouterWebServicesREST#testUpdateNodeResource` (also inherited by 
`TestFederationWebApp`) fails intermittently with:
   
       org.opentest4j.AssertionFailedError: expected: <4096> but was: <8192>
   
   The RM applies a node resource update asynchronously. 
`AdminService#updateNodeResource` only dispatches an 
`RMNodeResourceUpdateEvent`, and the new total is set later in 
`RMNodeImpl.UpdateNodeResourceWhenRunningTransition`. 
`RMWebServices#updateNodeResource` returns `rmNode.getTotalCapability()` right 
after dispatching. So when the dispatcher is busy, the POST response and the 
following GET still report the old 8192 MB.
   
   Test-only fix:
   - After the POST, wait (bounded at 5s, `LambdaTestUtils.eventually`) until a 
GET of the node reports the new memory and vcores.
   - Then repeat the same idempotent update and assert the Router's POST 
response, which now reads the already applied value.
   
   The test has no `@Timeout`, so the bounded wait is safe.
   
   Related: [YARN-12004](https://issues.apache.org/jira/browse/YARN-12004) / 
#8786 fixes the Router-vs-RM application lifecycle races in the same classes. 
It does not touch `testUpdateNodeResource`, so the two changes are independent.
   
   ### How was this patch tested?
   
   - Looped the test 200 times with a temporary `@RepeatedTest` subclass (not 
committed), with 8 threads submitting applications to the RM in the background:
     - before: 155/200 failures with the error above
     - after: 0/200 failures
   - Ran `TestRouterWebServicesREST` and `TestFederationWebApp` 4 times. 
`testUpdateNodeResource` passed in every run of both classes. The remaining 
intermittent failures in those classes (`testAppAttemptXML`, `testAppXML`, 
`testGetContainersXML`) also fail without this change and are covered by 
YARN-12004.
   
   ### For code changes:
   
   - [x] Does the title of this PR start with the corresponding JIRA issue id 
(e.g. 'HADOOP-17799. Your PR title ...')?
   - [ ] Object storage: Have the integration tests been executed and the 
endpoint declared according to the connector-specific documentation? (N/A, no 
object storage changes)
   - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under ASF 2.0? (N/A, no new 
dependencies)
   - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, 
`NOTICE-binary` files? (N/A)
   
   ### AI Tooling
   
   - [x] The PR includes the phrase "Contains content generated by Claude Code" 
where <tool> is the name of the AI tool used.
   - [x] My use of AI contributions follows the ASF legal policy 
https://www.apache.org/legal/generative-tooling.html
   
   Contains content generated by Claude Code.


-- 
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.

To unsubscribe, e-mail: [email protected]

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