You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/07/14 01:41:00 UTC

[jira] [Commented] (KAFKA-7162) Flaky unit tests caused by record creation timestamps differ from validation time by more than timestampDiffMaxMs

    [ https://issues.apache.org/jira/browse/KAFKA-7162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16543927#comment-16543927 ] 

ASF GitHub Bot commented on KAFKA-7162:
---------------------------------------

gitlw opened a new pull request #5367: KAFKA-7162: Fixing flaky tests
URL: https://github.com/apache/kafka/pull/5367
 
 
   Fixing the flaky tests by either
   1. Use the same timestamp in the records as the validation timestamp
   2. Disable the timestamp validation by using LOG_APPEND_TIME as the timestamp type because the time difference check will only apply when the timestamp type is CREATE_TIME, as shown in the LogValidator.validateTimestamp method.
   
   Testing done:
   Verified all the tests in the LogValidatorTest class passeh that after making the code changes.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Flaky unit tests caused by record creation timestamps differ from validation time by more than timestampDiffMaxMs
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-7162
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7162
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Lucas Wang
>            Assignee: Lucas Wang
>            Priority: Minor
>
> While running gradle unit tests, we found the test method LogValidatorTest.testCompressedV1 can fail sometimes. Upon investigation, it turns out the test method uses one set of timestamps, say t0, t1 and t2, for the records, while using a separate timestamp, say t3, for the "now" parameter when invoking the LogValidator.validateMessagesAndAssignOffsets method. The validateMessagesAndAssignOffsets validation method also takes a parameter timestampDiffMaxMs=1 second, that specifies the maximum allowed time different between t3 and the timestamps in records, i.e. t0, t1, and t2. While running unit tests, especially when multiple tests are run simultaneously, there is no guarantee that the time difference between t3 and t0 is within 1 second, causing the test method to flaky sometimes. Many other test methods in the LogValidatorTest can suffer from the same problem.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)