[
https://issues.apache.org/jira/browse/LENS-930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15395211#comment-15395211
]
Rajat Khandelwal commented on LENS-930:
---------------------------------------
I went through the code and DateUtil is not involved in this path. There's a
DateFactory which keeps dates cached. This cache is a two-level hash map
Map<UpdatePeriod, Map<Integer, Date>>, with a lazy computation of Date values
in the inner map. On first access of any <updatePeriod, offset> value, entry of
<updatePeriod, 0> is ensured and <updatePeriod, offset> is returned from cache
or calculated if required. This test case is hitting <DAILY, 0>, <DAILY, -1>
and <DAILY, -2>, which are supposed to be already present because of the static
initializer in DateFactory class.
The failure is in a between clause and the clause is <between 2 days back and
today>. Today is supposed to be at <DAILY, 0>, which seems unlikely to go wrong
because the scenario with <DAILY,0> being wrong but <DAILY,-2> being correct
isn't plausible since the latter is calculated based on the value of the
former.
Unsure of how to reproduce and debug this further. Will update if I think of
something. Suggestions are welcome.
> .TestBetweenTimeRangeWriter.testConsecutiveDayParts fails sometimes
> -------------------------------------------------------------------
>
> Key: LENS-930
> URL: https://issues.apache.org/jira/browse/LENS-930
> Project: Apache Lens
> Issue Type: Bug
> Components: cube
> Reporter: Amareshwari Sriramadasu
> Assignee: Rajat Khandelwal
> Fix For: 2.7
>
>
> Test failed here -
> https://builds.apache.org/job/Lens-Commit/org.apache.lens$lens-cube/1172/testReport/junit/org.apache.lens.cube.parse/TestBetweenTimeRangeWriter/testConsecutiveDayParts/
> org.apache.lens.cube.parse.TestBetweenTimeRangeWriter.testConsecutiveDayParts
> (from TestSuite)
> Failing for the past 1 build (Since Unstable#1172 )
> Took 5 ms.
> Error Message
> expected [ (test.dt BETWEEN '2016-01-19 12:22:16' AND '2016-01-21 12:22:16')
> ] but found [ (test.dt BETWEEN '2016-01-19 12:22:16' AND '2016-01-21
> 12:22:15') ]
> Stacktrace
> java.lang.AssertionError: expected [ (test.dt BETWEEN '2016-01-19 12:22:16'
> AND '2016-01-21 12:22:16') ] but found [ (test.dt BETWEEN '2016-01-19
> 12:22:16' AND '2016-01-21 12:22:15') ]
> at org.testng.Assert.fail(Assert.java:94)
> at org.testng.Assert.failNotEquals(Assert.java:494)
> at org.testng.Assert.assertEquals(Assert.java:123)
> at org.testng.Assert.assertEquals(Assert.java:176)
> at org.testng.Assert.assertEquals(Assert.java:186)
> at
> org.apache.lens.cube.parse.TestBetweenTimeRangeWriter.validateConsecutive(TestBetweenTimeRangeWriter.java:57)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)