Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Apr 18, 2019

Supersedes #7600.

@tseaver tseaver added api: spanner Issues related to the Spanner API. codegen labels Apr 18, 2019
@tseaver tseaver requested a review from busunkim96 April 18, 2019 19:40
@tseaver tseaver requested a review from crwilcox as a code owner April 18, 2019 19:40
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 18, 2019
@busunkim96
Copy link
Contributor

One of the system tests failed (only in system-2.7). Is it a flaky test?

_________ TestSessionAPI.test_transaction_batch_update_and_execute_dml _________
self = <tests.system.test_system.TestSessionAPI testMethod=test_transaction_batch_update_and_execute_dml>
    def test_transaction_batch_update_and_execute_dml(self):
        retry = RetryInstanceState(_has_all_ddl)
        retry(self._db.reload)()
        session = self._db.session()
        session.create()
        self.to_delete.append(session)
        with session.batch() as batch:
            batch.delete(self.TABLE, self.ALL)
        insert_statements = list(self._generate_insert_statements())
        update_statements = [
            (
                "UPDATE contacts SET email = @email " "WHERE contact_id = @contact_id;",
                {"contact_id": 1, "email": "[email protected]"},
                {"contact_id": Type(code=INT64), "email": Type(code=STRING)},
            )
        ]
        delete_statement = "DELETE contacts WHERE TRUE;"
        def unit_of_work(transaction, self):
            rows = list(transaction.read(self.TABLE, self.COLUMNS, self.ALL))
            self.assertEqual(rows, [])
            status, row_counts = transaction.batch_update(
                insert_statements + update_statements
            )
            self.assertEqual(status.code, 0)  # XXX: where are values defined?
            self.assertEqual(len(row_counts), len(insert_statements) + 1)
            for row_count in row_counts:
                self.assertEqual(row_count, 1)
            row_count = transaction.execute_update(delete_statement)
            self.assertEqual(row_count, len(insert_statements))
>       session.run_in_transaction(unit_of_work, self)
tests/system/test_system.py:861:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
google/cloud/spanner_v1/session.py:295: in run_in_transaction
    return_value = func(txn, *args, **kw)
tests/system/test_system.py:852: in unit_of_work
    self.assertEqual(status.code, 0)  # XXX: where are values defined?
E   AssertionError: 10 != 0
1 failed, 79 passed, 2 skipped in 101.00 seconds
Command py.test --quiet tests/system failed with exit code 1
Session system-2.7 failed.

@tseaver tseaver merged commit 3618354 into googleapis:master Apr 23, 2019
@tseaver tseaver deleted the spanner-manual-synth-20190418 branch April 23, 2019 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. cla: yes This human has signed the Contributor License Agreement. codegen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants