Himanshu Gahlaut created LENS-685:
-------------------------------------

             Summary: Assert on failed queries counter will fail intermittently
                 Key: LENS-685
                 URL: https://issues.apache.org/jira/browse/LENS-685
             Project: Apache Lens
          Issue Type: Sub-task
            Reporter: Himanshu Gahlaut


TestQueryService#testLaunchFail

{code}
assertTrue(metricsSvc.getTotalFailedQueries() >= failedQueries + 1);
{code}

This assert is asserting that a counter on totalFailedQueries should be 
incremented by 1, when a query fails. 

The counter is incremented in an asynchronous thread AsyncQueryStatusListener. 
If this assert is executed before the counter is incremented in asynchronous 
thread, then this assert will fail.

To reproduce this in master branch, introduce a infinite sleep before 
incrementing the counter at this line: 
https://github.com/apache/incubator-lens/blob/apache-lens-2.2.0-beta-incubating/lens-server/src/main/java/org/apache/lens/server/metrics/MetricsServiceImpl.java#L181

Run TestQueryService#testLaunchFail after this change the above assert will 
fail in master branch.







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

Reply via email to