Siyao Meng created HDDS-16802:
---------------------------------

             Summary: Intermittent failure in 
TestAuthorizationV4HeaderParser#testV4HeaderDateValidationSuccess
                 Key: HDDS-16802
                 URL: https://issues.apache.org/jira/browse/HDDS-16802
             Project: Apache Ozone
          Issue Type: Sub-task
          Components: S3, test
            Reporter: Siyao Meng
            Assignee: Siyao Meng


{code}
Tests run: 15, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.150 s <<< 
FAILURE! -- in 
org.apache.hadoop.ozone.s3.signature.TestAuthorizationV4HeaderParser
org.apache.hadoop.ozone.s3.signature.TestAuthorizationV4HeaderParser.testV4HeaderDateValidationSuccess
 -- Time elapsed: 0.004 s <<< 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.AuthorizationV4HeaderParser.parseCredentials(AuthorizationV4HeaderParser.java:189)
        at 
org.apache.hadoop.ozone.s3.signature.AuthorizationV4HeaderParser.parseSignature(AuthorizationV4HeaderParser.java:88)
        at 
org.apache.hadoop.ozone.s3.signature.TestAuthorizationV4HeaderParser.testRequestWithSpecificDate(TestAuthorizationV4HeaderParser.java:181)
        at 
org.apache.hadoop.ozone.s3.signature.TestAuthorizationV4HeaderParser.testV4HeaderDateValidationSuccess(TestAuthorizationV4HeaderParser.java:119)
{code}

h3. Root cause

The test sends {{X-Amz-Date}} set to now + 14 minutes but keeps the credential 
scope date at today's UTC date. Commit 29b98532703 made the parser require the 
scope date to equal the date part of {{X-Amz-Date}}. When the test runs within 
14 minutes of UTC midnight (this job ran at about 23:46 UTC), the timestamp 
falls on the next day and the check correctly rejects the request.

{{setup()}} has the same race on a much smaller window: {{curDate}} and 
{{sampleDate}} come from two separate {{now()}} calls.

h3. Fix

Derive the scope date and {{X-Amz-Date}} from the same {{LocalDateTime}} in 
both places.

- https://github.com/apache/ozone/actions/runs/37860058318/job/113597059210



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to