Skip to content

Commit 75da808

Browse files
fbivillerobsdedude
andauthored
Make rollback optional when dealing with unknown time zones
Co-authored-by: Rouven Bauer <[email protected]>
1 parent 0e9708f commit 75da808

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

tests/stub/types/scripts/v4x4/echo_unknown_zoned_date_time.script

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ S: <RAW> 8C 45 75 72 6f 70 65 2f 4e 65 6f 34 6a
2929
S: <RAW> 00 00
3030

3131
S: SUCCESS {"type": "r"}
32-
A: ROLLBACK
32+
# TODO: fix this once Go rolls back managed transactions on error (instead of relying on connection resets when they're put back to the pool)
33+
{{
34+
A: ROLLBACK
35+
----
36+
A: RESET
37+
}}
3338
*: RESET
3439
?: GOODBYE

tests/stub/types/scripts/v4x4/echo_unknown_zoned_date_time_patched.script

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ S: <RAW> 8C 45 75 72 6f 70 65 2f 4e 65 6f 34 6a
3030
S: <RAW> 00 00
3131

3232
S: SUCCESS {"type": "r"}
33-
A: ROLLBACK
33+
# TODO: fix this once Go rolls back managed transactions on error (instead of relying on connection resets when they're put back to the pool)
34+
{{
35+
A: ROLLBACK
36+
----
37+
A: RESET
38+
}}
3439
*: RESET
3540
?: GOODBYE

tests/stub/types/scripts/v5x0/echo_unknown_zoned_date_time.script

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ S: <RAW> 8C 45 75 72 6f 70 65 2f 4e 65 6f 34 6a
2929
S: <RAW> 00 00
3030

3131
S: SUCCESS {"type": "r"}
32-
A: ROLLBACK
32+
# TODO: fix this once Go rolls back managed transactions on error (instead of relying on connection resets when they're put back to the pool)
33+
{{
34+
A: ROLLBACK
35+
----
36+
A: RESET
37+
}}
3338
*: RESET
3439
?: GOODBYE

tests/stub/types/test_temporal_types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from nutkit.frontend import Driver
33
from tests.shared import (
44
driver_feature,
5+
get_driver_name,
56
TestkitTestCase,
67
)
78
from tests.stub.shared import StubServer
@@ -87,6 +88,10 @@ def work(tx):
8788
with self.assertRaises(types.DriverError):
8889
self._session.read_transaction(work)
8990
self._server.done()
91+
# TODO: Remove once all drivers roll back failed managed transactions
92+
if get_driver_name() not in ["go"]:
93+
rollback_count = self._server.count_requests("ROLLBACK")
94+
self.assertEqual(rollback_count, 1)
9095
self.assertEqual(tx_count, 1)
9196

9297
def _test_unknown_then_known_zoned_date_time(self, patched):

0 commit comments

Comments
 (0)