From feecd1f212509d29de59497d8ea5c63fda3c28e0 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Tue, 24 May 2022 00:48:46 +0200 Subject: [PATCH 1/2] gh-93117: Use correct size for sqlite3 deserialize bigmem test --- Lib/test/test_sqlite3/test_dbapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py index 840a401b6b3ee2..0bf360c71db7d9 100644 --- a/Lib/test/test_sqlite3/test_dbapi.py +++ b/Lib/test/test_sqlite3/test_dbapi.py @@ -627,7 +627,7 @@ def test_deserialize_corrupt_database(self): cx.execute("create table fail(f)") @unittest.skipUnless(sys.maxsize > 2**32, 'requires 64bit platform') - @bigmemtest(size=2**63, memuse=3, dry_run=False) + @bigmemtest(size=2**63, memuse=1, dry_run=False) def test_deserialize_too_much_data_64bit(self): with memory_database() as cx: with self.assertRaisesRegex(OverflowError, "'data' is too large"): From a48b03a7df7f294ef9457358d0981838420119f0 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Wed, 25 May 2022 11:30:35 +0200 Subject: [PATCH 2/2] Address review: remove unlikely test --- Lib/test/test_sqlite3/test_dbapi.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py index 0bf360c71db7d9..1fa02db3b3af41 100644 --- a/Lib/test/test_sqlite3/test_dbapi.py +++ b/Lib/test/test_sqlite3/test_dbapi.py @@ -29,7 +29,7 @@ import unittest import urllib.parse -from test.support import SHORT_TIMEOUT, bigmemtest, check_disallow_instantiation +from test.support import SHORT_TIMEOUT, check_disallow_instantiation from test.support import threading_helper from _testcapi import INT_MAX, ULLONG_MAX from os import SEEK_SET, SEEK_CUR, SEEK_END @@ -626,13 +626,6 @@ def test_deserialize_corrupt_database(self): # deserialized database. cx.execute("create table fail(f)") - @unittest.skipUnless(sys.maxsize > 2**32, 'requires 64bit platform') - @bigmemtest(size=2**63, memuse=1, dry_run=False) - def test_deserialize_too_much_data_64bit(self): - with memory_database() as cx: - with self.assertRaisesRegex(OverflowError, "'data' is too large"): - cx.deserialize(b"b" * size) - class OpenTests(unittest.TestCase): _sql = "create table test(id integer)"