You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Alexander Behm (JIRA)" <ji...@apache.org> on 2018/04/03 08:07:00 UTC

[jira] [Resolved] (IMPALA-6780) test_recover_paritions.py have always-true asserts

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

Alexander Behm resolved IMPALA-6780.
------------------------------------
       Resolution: Fixed
    Fix Version/s: Impala 2.13.0
                   Impala 3.0

commit d478c492bd4e1bac4ab84d63eafb788940e49d53
Author: Alex Behm <al...@cloudera.com>
Date:   Mon Apr 2 10:56:00 2018 -0700

    IMPALA-6780: Fix always-true asserts in test_recover_partitions.py
    
    Fixes the following syntax issue leading to an always-true assert:
    assert (cond, msg) <-- always true
    
    Instead, this should be used:
    assert cond, msg <-- cond and msg can optionally have parenthesis
    
    Testing:
    - Locally ran test_recover_partitions.py
    - Searched for other tests with similar mistakes (none identified)
    
    Change-Id: If38efa62c2496b69ae891bf916482d697bfc719f
    Reviewed-on: http://gerrit.cloudera.org:8080/9886
    Tested-by: Impala Public Jenkins
    Reviewed-by: Alex Behm <al...@cloudera.com>


> test_recover_paritions.py have always-true asserts
> --------------------------------------------------
>
>                 Key: IMPALA-6780
>                 URL: https://issues.apache.org/jira/browse/IMPALA-6780
>             Project: IMPALA
>          Issue Type: Task
>            Reporter: Philip Zeyliger
>            Assignee: Alexander Behm
>            Priority: Major
>             Fix For: Impala 3.0, Impala 2.13.0
>
>
> I discovered in the process of looking at IMPALA-6453 that we have some assertions that the Python 2.6 compiler thinks are always true. This seems like a true test bug.
> {code}
> /tmp/zz/mnt/tests/metadata/test_recover_partitions.py:91: SyntaxWarning: assertion is always true, perhaps remove parentheses?
>   assert (self.has_value(PART_NAME, result.data),
> /tmp/zz/mnt/tests/metadata/test_recover_partitions.py:95: SyntaxWarning: assertion is always true, perhaps remove parentheses?
>   assert (self.has_value(INSERTED_VALUE, result.data),
> /tmp/zz/mnt/tests/metadata/test_recover_partitions.py:108: SyntaxWarning: assertion is always true, perhaps remove parentheses?
>   assert (len(result.data) == old_length,
> /tmp/zz/mnt/tests/metadata/test_recover_partitions.py:124: SyntaxWarning: assertion is always true, perhaps remove parentheses?
>   assert (self.has_value("NULL", result.data),
> /tmp/zz/mnt/tests/metadata/test_recover_partitions.py:255: SyntaxWarning: assertion is always true, perhaps remove parentheses?
>   assert ((old_length + 1) == len(result.data),
> /tmp/zz/mnt/tests/metadata/test_recover_partitions.py:288: SyntaxWarning: assertion is always true, perhaps remove parentheses?
>   assert (self.has_value(INSERTED_VALUE, result.data),
> /tmp/zz/mnt/tests/metadata/test_recover_partitions.py:332: SyntaxWarning: assertion is always true, perhaps remove parentheses?
>   assert (len(result.data) == (old_length + 1),
> /tmp/zz/mnt/tests/metadata/test_recover_partitions.py:362: SyntaxWarning: assertion is always true, perhaps remove parentheses?
>   assert (self.count_partition(result.data) == 1,
> /tmp/zz/mnt/tests/metadata/test_recover_partitions.py:365: SyntaxWarning: assertion is always true, perhaps remove parentheses?
>   assert (self.count_value('p=100%25', result.data) == 1,
> /tmp/zz/mnt/tests/metadata/test_recover_partitions.py:389: SyntaxWarning: assertion is always true, perhaps remove parentheses?
>   assert (len(result.data) == old_length,
> {code}
> {code}
> >>> assert (False, "hey")
> <stdin>:1: SyntaxWarning: assertion is always true, perhaps remove parentheses?
> {code}



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