gitedmond opened a new pull request, #20457:
URL: https://github.com/apache/druid/pull/20457

   Fixes #20455.
   
   ### Description
   
   `AllocationMetricCollectorTest.testDelta` counted on each worker's `new 
Object()` calls being real heap allocations. The list of objects was never 
read, so the JIT could eliminate those allocations while the assertion still 
counted 16 bytes per object.
   
   Use two workers that publish retained byte arrays before the collector 
measures their allocation delta. The assertions compare the reported delta with 
the arrays' payload bytes and read the retained arrays after measurement. Join 
the workers during cleanup.
   
   ### Validation
   
   - Before the change, JDK 25 with `-Dsurefire.rerunFailingTestsCount=0`: 
`AllocationMetricCollectorTest` failed at line 61 (`delta3 > generatedSize3`), 
1 test run, 1 failure.
   - After the change, the full test class passed in one Maven test run and 10 
additional Surefire runs with retries disabled: 11/11 runs passed.
   - `mvn -B checkstyle:check -pl processing -DskipTests=true 
-Dweb.console.skip=true`: passed with 0 violations.
   - `git diff --check`: passed.
   
   This changes only the test fixture; no production behavior or public API 
changes.
   
   This PR has:
   
   - [x] been self-reviewed.
   - [x] updated an existing test to cover the allocation collector with 
observable allocations.
   


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