You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lens.apache.org by "Himanshu Gahlaut (JIRA)" <ji...@apache.org> on 2015/07/22 09:23:04 UTC

[jira] [Updated] (LENS-685) Assert on failed queries counter will fail intermittently

     [ https://issues.apache.org/jira/browse/LENS-685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Himanshu Gahlaut updated LENS-685:
----------------------------------
    Description: 
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 and the above assert will fail in master branch.





  was:
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.






> 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 and the above assert will fail in master branch.



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