2323class TestPostgreSQLPerformance :
2424 """Performance tests for PostgreSQL loader"""
2525
26- def test_large_table_loading_performance (self , postgresql_config , performance_test_data , memory_monitor ):
26+ def test_large_table_loading_performance (self , postgresql_test_config , performance_test_data , memory_monitor ):
2727 """Test loading large datasets with performance monitoring"""
28- loader = PostgreSQLLoader (postgresql_config )
28+ loader = PostgreSQLLoader (postgresql_test_config )
2929
3030 with loader :
3131 start_time = time .time ()
@@ -59,7 +59,7 @@ def test_large_table_loading_performance(self, postgresql_config, performance_te
5959 finally :
6060 loader .pool .putconn (conn )
6161
62- def test_batch_performance_scaling (self , postgresql_config , performance_test_data ):
62+ def test_batch_performance_scaling (self , postgresql_test_config , performance_test_data ):
6363 """Test performance scaling with different batch processing approaches"""
6464 from src .amp .loaders .base import LoadMode
6565
@@ -72,7 +72,7 @@ def test_batch_performance_scaling(self, postgresql_config, performance_test_dat
7272 results = {}
7373
7474 for approach_name , batch_size in batch_approaches .items ():
75- loader = PostgreSQLLoader (postgresql_config )
75+ loader = PostgreSQLLoader (postgresql_test_config )
7676 table_name = f'perf_batch_{ approach_name } '
7777
7878 with loader :
@@ -123,9 +123,9 @@ def test_batch_performance_scaling(self, postgresql_config, performance_test_dat
123123 for approach , throughput in results .items ():
124124 assert throughput > 500 , f'{ approach } too slow: { throughput :.0f} rows/sec'
125125
126- def test_connection_pool_performance (self , postgresql_config , small_test_table ):
126+ def test_connection_pool_performance (self , postgresql_test_config , small_test_table ):
127127 """Test connection pool efficiency under load"""
128- config = {** postgresql_config , 'max_connections' : 5 }
128+ config = {** postgresql_test_config , 'max_connections' : 5 }
129129 loader = PostgreSQLLoader (config )
130130
131131 with loader :
@@ -1016,7 +1016,7 @@ class TestCrossLoaderPerformance:
10161016
10171017 def test_throughput_comparison (
10181018 self ,
1019- postgresql_config ,
1019+ postgresql_test_config ,
10201020 redis_test_config ,
10211021 snowflake_config ,
10221022 delta_basic_config ,
@@ -1027,7 +1027,7 @@ def test_throughput_comparison(
10271027 results = {}
10281028
10291029 # Test PostgreSQL
1030- pg_loader = PostgreSQLLoader (postgresql_config )
1030+ pg_loader = PostgreSQLLoader (postgresql_test_config )
10311031 with pg_loader :
10321032 start_time = time .time ()
10331033 result = pg_loader .load_table (medium_test_table , 'throughput_test' )
@@ -1120,7 +1120,9 @@ def test_throughput_comparison(
11201120 if throughput > 0 :
11211121 print (f' { loader_name } : { throughput :.0f} ' )
11221122
1123- def test_memory_usage_comparison (self , postgresql_config , redis_test_config , snowflake_config , small_test_table ):
1123+ def test_memory_usage_comparison (
1124+ self , postgresql_test_config , redis_test_config , snowflake_config , small_test_table
1125+ ):
11241126 """Compare memory usage patterns across loaders"""
11251127 try :
11261128 import psutil
@@ -1132,7 +1134,7 @@ def test_memory_usage_comparison(self, postgresql_config, redis_test_config, sno
11321134
11331135 # Test PostgreSQL memory usage
11341136 initial_memory = process .memory_info ().rss
1135- pg_loader = PostgreSQLLoader (postgresql_config )
1137+ pg_loader = PostgreSQLLoader (postgresql_test_config )
11361138 with pg_loader :
11371139 pg_loader .load_table (small_test_table , 'memory_test' )
11381140 peak_memory = process .memory_info ().rss
0 commit comments