You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 8, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 8, 2026. It is now read-only.
def test_staleness(shared_instance, dbapi_database):
"""Check the DB API `staleness` option."""
conn = Connection(shared_instance, dbapi_database)
cursor = conn.cursor()
before_insert = datetime.datetime.utcnow().replace(tzinfo=UTC)
cursor.execute(
"""
INSERT INTO contacts (contact_id, first_name, last_name, email)
VALUES (1, 'first-name', 'last-name', 'test.email@example.com')
"""
)
conn.commit()
conn.read_only = True
conn.staleness = {"read_timestamp": before_insert}
cursor.execute("SELECT * FROM contacts")
conn.commit()
assert len(cursor.fetchall()) == 0
E AssertionError: assert 1 == 0
E + where 1 = len([(1, 'first-name', 'last-name', 'test.email@example.com')])
E + where [(1, 'first-name', 'last-name', 'test.email@example.com')] = <bound method check_not_closed..wrapper of <google.cloud.spanner_dbapi.cursor.Cursor object at 0x7fcdc790fd00>>()
E + where <bound method check_not_closed..wrapper of <google.cloud.spanner_dbapi.cursor.Cursor object at 0x7fcdc790fd00>> = <google.cloud.spanner_dbapi.cursor.Cursor object at 0x7fcdc790fd00>.fetchall
def test_staleness(shared_instance, dbapi_database):
"""Check the DB API `staleness` option."""
conn = Connection(shared_instance, dbapi_database)
cursor = conn.cursor()
before_insert = datetime.datetime.utcnow().replace(tzinfo=UTC)
cursor.execute(
"""
INSERT INTO contacts (contact_id, first_name, last_name, email)
VALUES (1, 'first-name', 'last-name', 'test.email@example.com')
"""
)
conn.commit()
conn.read_only = True
conn.staleness = {"read_timestamp": before_insert}
cursor.execute("SELECT * FROM contacts")
conn.commit()
assert len(cursor.fetchall()) == 0
E AssertionError: assert 1 == 0
E + where 1 = len([(1, 'first-name', 'last-name', 'test.email@example.com')])
E + where [(1, 'first-name', 'last-name', 'test.email@example.com')] = <bound method check_not_closed..wrapper of <google.cloud.spanner_dbapi.cursor.Cursor object at 0x7f8a8451c490>>()
E + where <bound method check_not_closed..wrapper of <google.cloud.spanner_dbapi.cursor.Cursor object at 0x7f8a8451c490>> = <google.cloud.spanner_dbapi.cursor.Cursor object at 0x7f8a8451c490>.fetchall
Activity
flaky-bot commentedon Jun 18, 2022
Looks like this issue is flaky. 😟
I'm going to leave this open and stop commenting.
A human should fix and close this.
When run at the same commit (5d8b055), this test passed in one build (Build Status, Sponge) and failed in another build (Build Status, Sponge).
ansh0l commentedon Jun 27, 2022
This looks transient as discussed with @asthamohta , will monitor it for a few days, so keeping it open.
flaky-bot commentedon Jul 2, 2022
Oops! Looks like this issue is still flaky. It failed again. 😬
I reopened the issue, but a human will need to close it again.
commit: c077480
buildURL: Build Status, Sponge
status: failed
Test output