@@ -43,7 +43,6 @@ async def _cancel(self, waiter):
4343
4444class TestPool (tb .ConnectedTestCase ):
4545
46- @unittest .skip ("UNLISTEN statement is not yet supported." )
4746async def test_pool_01 (self ):
4847for n in {1 , 5 , 10 , 20 , 100 }:
4948with self .subTest (tasksnum = n ):
@@ -59,7 +58,6 @@ async def worker():
5958await asyncio .gather (* tasks )
6059await pool .close ()
6160
62- @unittest .skip ("UNLISTEN statement is not yet supported." )
6361async def test_pool_02 (self ):
6462for n in {1 , 3 , 5 , 10 , 20 , 100 }:
6563with self .subTest (tasksnum = n ):
@@ -108,7 +106,6 @@ async def test_pool_04(self):
108106
109107pool .terminate ()
110108
111- @unittest .skip ("UNLISTEN statement is not yet supported." )
112109async def test_pool_05 (self ):
113110for n in {1 , 3 , 5 , 10 , 20 , 100 }:
114111with self .subTest (tasksnum = n ):
@@ -123,7 +120,6 @@ async def worker():
123120await asyncio .gather (* tasks )
124121await pool .close ()
125122
126- @unittest .skip ("UNLISTEN statement is not yet supported." )
127123async def test_pool_06 (self ):
128124fut = asyncio .Future ()
129125
@@ -206,7 +202,6 @@ async def test_pool_08(self):
206202with self .assertRaisesRegex (async_gaussdb .InterfaceError , 'is not a member' ):
207203await pool .release (con ._con )
208204
209- @unittest .skip ("UNLISTEN statement is not yet supported." )
210205async def test_pool_09 (self ):
211206pool1 = await self .create_pool (database = 'postgres' ,
212207min_size = 1 , max_size = 1 )
@@ -225,7 +220,6 @@ async def test_pool_09(self):
225220await pool1 .close ()
226221await pool2 .close ()
227222
228- @unittest .skip ("UNLISTEN statement is not yet supported." )
229223async def test_pool_10 (self ):
230224pool = await self .create_pool (database = 'postgres' ,
231225min_size = 1 , max_size = 1 )
@@ -236,7 +230,6 @@ async def test_pool_10(self):
236230
237231await pool .close ()
238232
239- @unittest .skip ("UNLISTEN statement is not yet supported." )
240233async def test_pool_11 (self ):
241234pool = await self .create_pool (database = 'postgres' ,
242235min_size = 1 , max_size = 1 )
@@ -294,7 +287,6 @@ async def test_pool_11(self):
294287
295288await pool .close ()
296289
297- @unittest .skip ("UNLISTEN statement is not yet supported." )
298290async def test_pool_12 (self ):
299291pool = await self .create_pool (database = 'postgres' ,
300292min_size = 1 , max_size = 1 )
@@ -305,7 +297,6 @@ async def test_pool_12(self):
305297
306298await pool .close ()
307299
308- @unittest .skip ("UNLISTEN statement is not yet supported." )
309300async def test_pool_13 (self ):
310301pool = await self .create_pool (database = 'postgres' ,
311302min_size = 1 , max_size = 1 )
@@ -325,7 +316,6 @@ def test_pool_init_run_until_complete(self):
325316pool = self .loop .run_until_complete (pool_init )
326317self .assertIsInstance (pool , async_gaussdb .pool .Pool )
327318
328- @unittest .skip ("UNLISTEN statement is not yet supported." )
329319async def test_pool_exception_in_setup_and_init (self ):
330320class Error (Exception ):
331321pass
@@ -419,7 +409,6 @@ async def worker():
419409self .cluster .trust_local_connections ()
420410self .cluster .reload ()
421411
422- @unittest .skip ("UNLISTEN statement is not yet supported." )
423412async def test_pool_handles_task_cancel_in_acquire_with_timeout (self ):
424413# See https://github.com/MagicStack/async_gaussdb/issues/547
425414pool = await self .create_pool (database = 'postgres' ,
@@ -440,7 +429,6 @@ async def worker():
440429# Check that the connection has been returned to the pool.
441430self .assertEqual (pool ._queue .qsize (), 1 )
442431
443- @unittest .skip ("UNLISTEN statement is not yet supported." )
444432async def test_pool_handles_task_cancel_in_release (self ):
445433# Use SlowResetConnectionPool to simulate
446434# the Task.cancel() and __aexit__ race.
@@ -462,7 +450,6 @@ async def worker():
462450# Check that the connection has been returned to the pool.
463451self .assertEqual (pool ._queue .qsize (), 1 )
464452
465- @unittest .skip ("UNLISTEN statement is not yet supported." )
466453async def test_pool_handles_query_cancel_in_release (self ):
467454# Use SlowResetConnectionPool to simulate
468455# the Task.cancel() and __aexit__ race.
@@ -528,7 +515,6 @@ async def test(pool):
528515
529516self .assertEqual (len (cons ), N )
530517
531- @unittest .skip ("UNLISTEN statement is not yet supported." )
532518async def test_pool_release_in_xact (self ):
533519"""Test that Connection.reset() closes any open transaction."""
534520async with self .create_pool (database = 'postgres' ,
@@ -558,7 +544,6 @@ async def get_xact_id(con):
558544id3 = await get_xact_id (con )
559545self .assertNotEqual (id2 , id3 )
560546
561- @unittest .skip ("UNLISTEN statement is not yet supported." )
562547async def test_pool_connection_methods (self ):
563548async def test_fetch (pool ):
564549i = random .randint (0 , 20 )
@@ -610,7 +595,6 @@ async def run(N, meth):
610595with self .subTest (method = method .__name__ ):
611596await run (200 , method )
612597
613- @unittest .skip ("UNLISTEN statement is not yet supported." )
614598async def test_pool_connection_execute_many (self ):
615599async def worker (pool ):
616600await asyncio .sleep (random .random () / 100 )
@@ -639,7 +623,6 @@ async def worker(pool):
639623finally :
640624await pool .execute ('DROP TABLE exmany' )
641625
642- @unittest .skip ("UNLISTEN statement is not yet supported." )
643626async def test_pool_max_inactive_time_01 (self ):
644627async with self .create_pool (
645628database = 'postgres' , min_size = 1 , max_size = 1 ,
@@ -659,7 +642,6 @@ async def test_pool_max_inactive_time_01(self):
659642'SELECT 1' )
660643self .assertIs (pool ._holders [0 ]._con , con )
661644
662- @unittest .skip ("UNLISTEN statement is not yet supported." )
663645async def test_pool_max_inactive_time_02 (self ):
664646async with self .create_pool (
665647database = 'postgres' , min_size = 1 , max_size = 1 ,
@@ -683,7 +665,6 @@ async def test_pool_max_inactive_time_02(self):
683665'SELECT 1' )
684666self .assertIsNot (pool ._holders [0 ]._con , con )
685667
686- @unittest .skip ("UNLISTEN statement is not yet supported." )
687668async def test_pool_max_inactive_time_03 (self ):
688669async with self .create_pool (
689670database = 'postgres' , min_size = 1 , max_size = 1 ,
@@ -704,7 +685,6 @@ async def test_pool_max_inactive_time_03(self):
704685'SELECT 1' )
705686self .assertIs (pool ._holders [0 ]._con , con )
706687
707- @unittest .skip ("UNLISTEN statement is not yet supported." )
708688async def test_pool_max_inactive_time_04 (self ):
709689# Chaos test for max_inactive_connection_lifetime.
710690DURATION = 2.0
@@ -736,14 +716,14 @@ async def worker(pool):
736716
737717self .assertGreaterEqual (N , 50 )
738718
739- @unittest .skip ("UNLISTEN statement is not yet supported." )
740719async def test_pool_max_inactive_time_05 (self ):
741720# Test that idle never-acquired connections abide by
742721# the max inactive lifetime.
743722async with self .create_pool (
744723database = 'postgres' , min_size = 2 , max_size = 2 ,
745- max_inactive_connection_lifetime = 0.2 ) as pool :
724+ max_inactive_connection_lifetime = 0.3 ) as pool :
746725
726+ await asyncio .sleep (0.02 )
747727self .assertIsNotNone (pool ._holders [0 ]._con )
748728self .assertIsNotNone (pool ._holders [1 ]._con )
749729
@@ -755,7 +735,6 @@ async def test_pool_max_inactive_time_05(self):
755735# but should be closed nonetheless.
756736self .assertIs (pool ._holders [1 ]._con , None )
757737
758- @unittest .skip ("UNLISTEN statement is not yet supported." )
759738async def test_pool_handles_inactive_connection_errors (self ):
760739pool = await self .create_pool (database = 'postgres' ,
761740min_size = 1 , max_size = 1 )
@@ -776,7 +755,6 @@ async def test_pool_handles_inactive_connection_errors(self):
776755
777756await pool .close ()
778757
779- @unittest .skip ("UNLISTEN statement is not yet supported." )
780758async def test_pool_size_and_capacity (self ):
781759async with self .create_pool (
782760database = 'postgres' ,
@@ -809,7 +787,6 @@ async def test_pool_closing(self):
809787pool .terminate ()
810788self .assertTrue (pool .is_closing ())
811789
812- @unittest .skip ("UNLISTEN statement is not yet supported." )
813790async def test_pool_handles_transaction_exit_in_asyncgen_1 (self ):
814791pool = await self .create_pool (database = 'postgres' ,
815792min_size = 1 , max_size = 1 )
@@ -831,7 +808,6 @@ class MyException(Exception):
831808async for _ in iterate (con ): # noqa
832809raise MyException ()
833810
834- @unittest .skip ("UNLISTEN statement is not yet supported." )
835811async def test_pool_handles_transaction_exit_in_asyncgen_2 (self ):
836812pool = await self .create_pool (database = 'postgres' ,
837813min_size = 1 , max_size = 1 )
@@ -856,7 +832,6 @@ class MyException(Exception):
856832
857833del iterator
858834
859- @unittest .skip ("UNLISTEN statement is not yet supported." )
860835async def test_pool_handles_asyncgen_finalization (self ):
861836pool = await self .create_pool (database = 'postgres' ,
862837min_size = 1 , max_size = 1 )
@@ -878,7 +853,6 @@ class MyException(Exception):
878853async for _ in iterate (con ): # noqa
879854raise MyException ()
880855
881- @unittest .skip ("UNLISTEN statement is not yet supported." )
882856async def test_pool_close_waits_for_release (self ):
883857pool = await self .create_pool (database = 'postgres' ,
884858min_size = 1 , max_size = 1 )
@@ -934,7 +908,6 @@ async def test_pool_expire_connections(self):
934908self .assertIsNone (pool ._holders [0 ]._con )
935909await pool .close ()
936910
937- @unittest .skip ("UNLISTEN statement is not yet supported." )
938911async def test_pool_set_connection_args (self ):
939912pool = await self .create_pool (database = 'postgres' ,
940913min_size = 1 , max_size = 1 )
@@ -1007,7 +980,6 @@ async def test_pool_init_and_use_race(self):
1007980await pool_task
1008981await pool .close ()
1009982
1010- @unittest .skip ("UNLISTEN statement is not yet supported." )
1011983async def test_pool_remote_close (self ):
1012984pool = await self .create_pool (min_size = 1 , max_size = 1 )
1013985backend_pid_fut = self .loop .create_future ()
0 commit comments