smengcl opened a new pull request, #11453:
URL: https://github.com/apache/ozone/pull/11453

   Generated-by: Claude Code (Opus 5.5)
   
   ## What changes were proposed in this pull request?
   
   `TestAuthorizationV4HeaderParser#testV4HeaderDateValidationSuccess` fails 
when it runs within 14 minutes of UTC midnight:
   
   ```
   TestAuthorizationV4HeaderParser.testV4HeaderDateValidationSuccess <<< ERROR!
   org.apache.hadoop.ozone.s3.signature.MalformedResourceException
        at 
org.apache.hadoop.ozone.s3.signature.Credential.validateScopeDateMatchesAmzDate(Credential.java:125)
        ...
        at 
org.apache.hadoop.ozone.s3.signature.TestAuthorizationV4HeaderParser.testV4HeaderDateValidationSuccess(TestAuthorizationV4HeaderParser.java:119)
   ```
   
   The test sends `X-Amz-Date` as now + 14 minutes but keeps the credential 
scope date at today. The parser requires the scope date to match the date part 
of `X-Amz-Date` (29b98532703), so near midnight the request is correctly 
rejected. The failing job ran at about 23:46 UTC.
   
   The fix derives the scope date and `X-Amz-Date` from the same 
`LocalDateTime`. The same change is applied in `setup()`, where `curDate` and 
`sampleDate` came from two separate `now()` calls (same race, much smaller 
window).
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16802
   
   ## How was this patch tested?
   
   - `mvn -pl :ozone-s3gateway test -Dtest=TestAuthorizationV4HeaderParser`: 15 
tests, all pass.
   - The fix is deterministic by construction: both values are formatted from 
one `LocalDateTime`, so they always fall on the same day regardless of when the 
test runs.
   - 10x10 
[flaky-test-check](https://github.com/smengcl/hadoop-ozone/actions/runs/37867713757)
 on this branch: passed 100/100
   
   🤖 Generated with [Claude Code](https://claude.com/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