You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Vinay Chella (JIRA)" <ji...@apache.org> on 2019/02/15 09:00:10 UTC

[jira] [Updated] (CASSANDRA-15021) TestBootstrapAfterUpgrade.test_upgrade_with_range_tombstone_eoc_0 upgrade test is failing with TypeError

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

Vinay Chella updated CASSANDRA-15021:
-------------------------------------
    Status: Patch Available  (was: Open)

I went ahead and made [composite|https://github.com/apache/cassandra-dtest/blob/master/thrift_test.py#L147] function compatible with python2 and python3, this should fix the {{TypeError}} in {{test_upgrade_with_range_tombstone_eoc_0}}
||dtest||upgrade-test||
|[dtest-fix-branch|https://github.com/vinaykumarchella/cassandra-dtest/tree/CASSANDRA-15021]|[!https://circleci.com/gh/vinaykumarchella/cassandra/tree/3.11.4-tentative.svg?circle-token=237fa63201f848ed64789902be862015f74bec9b!|https://circleci.com/gh/vinaykumarchella/cassandra/358]|

> TestBootstrapAfterUpgrade.test_upgrade_with_range_tombstone_eoc_0 upgrade test is failing with TypeError
> --------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-15021
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15021
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Test/dtest
>            Reporter: Vinay Chella
>            Assignee: Vinay Chella
>            Priority: Minor
>              Labels: dtest, test, upgrade-dtest
>
> While running upgrade tests for 3.11.4 candidate I noticed that {{upgrade_tests.storage_engine_upgrade_test.TestBootstrapAfterUpgrade.test_upgrade_with_range_tombstone_eoc_0}} is failing with TypeError.
> Example run with error:
> {code:java}
> self = <upgrade_tests.storage_engine_upgrade_test.TestBootstrapAfterUpgrade object at 0x7f8db9908240>
>     @since('3.0', max_version='3.99')
>     def test_upgrade_with_range_tombstone_eoc_0(self):
>         """
>             Check sstable upgrading when the sstable contains a range tombstone with EOC=0.
>     
>             @jira_ticket CASSANDRA-12423
>             """
>         session = self._setup_cluster(cluster_options={'start_rpc': 'true'})
>     
>         session.execute("CREATE TABLE rt (id INT, c1 TEXT, c2 TEXT, v INT, PRIMARY KEY (id, c1, c2)) "
>                         "with compact storage and compression = {'sstable_compression': ''};")
>     
>         range_delete = {
>             i32(1): {
>                 'rt': [Mutation(deletion=Deletion(2470761440040513,
>                                                   predicate=SlicePredicate(slice_range=SliceRange(
> >                                                     start=composite('a', eoc='\x00'),
>                                                       finish=composite('asd', eoc='\x00')))))]
>             }
>         }
> upgrade_tests/storage_engine_upgrade_test.py:434: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> item1 = b'a', item2 = None, eoc = '\x00'
>     def composite(item1, item2=None, eoc=b'\x00'):
>         if isinstance(item1, str):
>             item1 = utf8encode(item1)
>         if isinstance(item2, str):
>             item2 = utf8encode(item2)
>     
> >       packed = _i16(len(item1)) + item1 + eoc
> E       TypeError: can't concat str to bytes
> thrift_test.py:153: TypeError
> {code}
> This TypeError is from Python3 migration. Python 3's standard string type is Unicode based, and Python 3 adds a dedicated bytes type, but critically, no automatic coercion between bytes and unicode strings is provided - [context|https://www.python.org/dev/peps/pep-0404/#strings-and-bytes]
> This change in python3 is leading to "TypeError: can't concat str to bytes" while appending bytes to string.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org