Skip to content

Conversation

@tswast
Copy link
Contributor

@tswast tswast commented Dec 16, 2021

Workaround for internal issue 210907595

@tswast tswast requested a review from a team December 16, 2021 16:23
@tswast tswast requested review from a team as code owners December 16, 2021 16:23
@tswast tswast requested a review from loferris December 16, 2021 16:23
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Dec 16, 2021
@tswast tswast added the automerge Merge the pull request once unit tests and other checks pass. label Dec 16, 2021
@tswast
Copy link
Contributor Author

tswast commented Dec 16, 2021

Three test failures all in the same spot:

___________ TestBigQuery.test_dbapi_connection_does_not_leak_sockets ___________

self = <tests.system.test_client.TestBigQuery testMethod=test_dbapi_connection_does_not_leak_sockets>

    @unittest.skipIf(
        bigquery_storage is None, "Requires `google-cloud-bigquery-storage`"
    )
    def test_dbapi_connection_does_not_leak_sockets(self):
        current_process = psutil.Process()
        conn_count_start = len(current_process.connections())

        # Provide no explicit clients, so that the connection will create and own them.
        connection = dbapi.connect()
        cursor = connection.cursor()

        cursor.execute(
            """
            SELECT id, `by`, time_ts
            FROM `bigquery-public-data.hacker_news.comments`
            ORDER BY `id` ASC
            LIMIT 100000
        """
        )
        rows = cursor.fetchall()
        self.assertEqual(len(rows), 100000)

        connection.close()
        conn_count_end = len(current_process.connections())
>       self.assertEqual(conn_count_end, conn_count_start)
E       AssertionError: 3 != 7

tests/system/test_client.py:1728: AssertionError

Possibly just some flakiness with how long it takes to close a read API grpc connection?

@tswast tswast merged commit dc42670 into main Dec 16, 2021
@tswast tswast deleted the b210907595-copy-table-tests branch December 16, 2021 16:51
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Dec 16, 2021
abdelmegahedgoogle pushed a commit to abdelmegahedgoogle/python-bigquery that referenced this pull request Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/python-bigquery API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants