From 6579a3850a8166b4e463550ace39a4374a6be225 Mon Sep 17 00:00:00 2001 From: Piotr Sarna Date: Wed, 4 Sep 2019 14:18:27 +0200 Subject: [PATCH] alternator-test: add xfail test for GSI with 2 regular columns When updating the second regular base column that is also a view key, the code in Scylla will assume it only needs to update an entry instead of replacing an old one. This leads to inconsitencies exposed in the test case. Message-Id: <5dfeb9f61f986daa6e480e9da4c7aabb5a09a4ec.1567599461.git.sarna@scylladb.com> --- alternator-test/test_gsi.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/alternator-test/test_gsi.py b/alternator-test/test_gsi.py index 1464611e5a..e03140092f 100644 --- a/alternator-test/test_gsi.py +++ b/alternator-test/test_gsi.py @@ -377,6 +377,19 @@ def test_gsi_3(test_table_gsi_3): KeyConditions={'a': {'AttributeValueList': [items[3]['a']], 'ComparisonOperator': 'EQ'}, 'b': {'AttributeValueList': [items[3]['b']], 'ComparisonOperator': 'EQ'}}) +@pytest.mark.xfail(reason="GSI in alternator currently have a bug on updating the second regular base column") +def test_gsi_update_second_regular_base_column(test_table_gsi_3): + items = [{'p': random_string(), 'a': random_string(), 'b': random_string(), 'd': random_string()} for i in range(10)] + with test_table_gsi_3.batch_writer() as batch: + for item in items: + batch.put_item(item) + items[3]['b'] = 'updated' + test_table_gsi_3.update_item(Key={'p': items[3]['p']}, AttributeUpdates={'b': {'Value': 'updated', 'Action': 'PUT'}}) + assert_index_query(test_table_gsi_3, 'hello', [items[3]], + KeyConditions={'a': {'AttributeValueList': [items[3]['a']], 'ComparisonOperator': 'EQ'}, + 'b': {'AttributeValueList': [items[3]['b']], 'ComparisonOperator': 'EQ'}}) + + # A fourth scenario of GSI. Two GSIs on a single base table. @pytest.fixture(scope="session") def test_table_gsi_4(dynamodb):