You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Karan Singhal (JIRA)" <ji...@apache.org> on 2016/01/13 12:59:39 UTC

[jira] [Commented] (PHOENIX-2592) Pherf RuleGeneratorTest.testDateGenerator() is flapping

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

Karan Singhal commented on PHOENIX-2592:
----------------------------------------

[~giacomotaylor] Was just curios to know why this is happening so just spent  little time to find out the issue. The reason it's happening is because the function (randomDataGenerator.nextLong (minDt.getMillis(), maxDt.getMillis() ) ) which is being used to  generate random date between two limits generates data with endpoints included.  And the assertion in RuleGenratorTest class is  assertDateBetween which checks the date generated is exactly between limits and it fails sometimes because date generated is sometimes same as limits as in the above stack-trace we can see.   

I have a very simple fix for this we just have to add 1 unit to lower limit and subtract 1  from upper limit when we pass the limits to function, this will make sure the data generated is exactly between limits.

This test is there from starting so don't know why this issue didn't happen before, may be probability is really very low so never occurred such frequently. I never got this error in so many builds.  But for sure this is a bug and needs to be fixed. 

Let me know if I can go ahead and submit patch for this.
   

> Pherf RuleGeneratorTest.testDateGenerator() is flapping
> -------------------------------------------------------
>
>                 Key: PHOENIX-2592
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2592
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: Cody Marcel
>
> See https://builds.apache.org/job/Phoenix-4.x-HBase-1.0/315/changes
> {code}
> Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.807 sec <<< FAILURE! - in org.apache.phoenix.pherf.RuleGeneratorTest
> testDateGenerator(org.apache.phoenix.pherf.RuleGeneratorTest)  Time elapsed: 0.373 sec  <<< FAILURE!
> java.lang.AssertionError: Value 2019-09-22T00:01:00.000Z is not after minValue
> 	at org.apache.phoenix.pherf.RuleGeneratorTest.assertDateBetween(RuleGeneratorTest.java:259)
> 	at org.apache.phoenix.pherf.RuleGeneratorTest.assertRandomDateValue(RuleGeneratorTest.java:133)
> 	at org.apache.phoenix.pherf.RuleGeneratorTest.testDateGenerator(RuleGeneratorTest.java:57)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)