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):