Skip to content

Commit 8523877

Browse files
committed
tests/performance: Fix config fixture usage in Redis loader tests
1 parent cb9a2c5 commit 8523877

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

tests/performance/test_loader_performance.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ def test_connection_pool_performance(self, postgresql_config, small_test_table):
155155
class TestRedisPerformance:
156156
"""Performance tests for Redis loader"""
157157

158-
def test_pipeline_performance(self, redis_config, performance_test_data):
158+
def test_pipeline_performance(self, redis_test_config, performance_test_data):
159159
"""Test Redis pipeline performance optimization"""
160160
# Test with and without pipelining
161161
configs = [
162-
{**redis_config, 'pipeline_size': 1, 'data_structure': 'hash'},
163-
{**redis_config, 'pipeline_size': 1000, 'data_structure': 'hash'},
162+
{**redis_test_config, 'pipeline_size': 1, 'data_structure': 'hash'},
163+
{**redis_test_config, 'pipeline_size': 1000, 'data_structure': 'hash'},
164164
]
165165

166166
results = {}
@@ -193,14 +193,14 @@ def test_pipeline_performance(self, redis_config, performance_test_data):
193193
},
194194
)
195195

196-
def test_data_structure_performance(self, redis_config, performance_test_data):
196+
def test_data_structure_performance(self, redis_test_config, performance_test_data):
197197
"""Compare performance across Redis data structures"""
198198
structures = ['hash', 'string', 'sorted_set']
199199
results = {}
200200

201201
for structure in structures:
202202
config = {
203-
**redis_config,
203+
**redis_test_config,
204204
'data_structure': structure,
205205
'pipeline_size': 1000,
206206
'score_field': 'score' if structure == 'sorted_set' else None,
@@ -233,9 +233,9 @@ def test_data_structure_performance(self, redis_config, performance_test_data):
233233
},
234234
)
235235

236-
def test_memory_efficiency(self, redis_config, performance_test_data, memory_monitor):
236+
def test_memory_efficiency(self, redis_test_config, performance_test_data, memory_monitor):
237237
"""Test Redis loader memory efficiency"""
238-
config = {**redis_config, 'data_structure': 'hash', 'pipeline_size': 1000}
238+
config = {**redis_test_config, 'data_structure': 'hash', 'pipeline_size': 1000}
239239
loader = RedisLoader(config)
240240

241241
with loader:
@@ -1015,7 +1015,13 @@ class TestCrossLoaderPerformance:
10151015
"""Performance comparison tests across all loaders"""
10161016

10171017
def test_throughput_comparison(
1018-
self, postgresql_config, redis_config, snowflake_config, delta_basic_config, lmdb_perf_config, medium_test_table
1018+
self,
1019+
postgresql_config,
1020+
redis_test_config,
1021+
snowflake_config,
1022+
delta_basic_config,
1023+
lmdb_perf_config,
1024+
medium_test_table,
10191025
):
10201026
"""Compare throughput across all loaders with medium dataset"""
10211027
results = {}
@@ -1036,7 +1042,7 @@ def test_throughput_comparison(
10361042
pg_loader.pool.putconn(conn)
10371043

10381044
# Test Redis
1039-
redis_config_perf = {**redis_config, 'data_structure': 'hash', 'pipeline_size': 1000}
1045+
redis_config_perf = {**redis_test_config, 'data_structure': 'hash', 'pipeline_size': 1000}
10401046
redis_loader = RedisLoader(redis_config_perf)
10411047
with redis_loader:
10421048
start_time = time.time()
@@ -1114,7 +1120,7 @@ def test_throughput_comparison(
11141120
if throughput > 0:
11151121
print(f' {loader_name}: {throughput:.0f}')
11161122

1117-
def test_memory_usage_comparison(self, postgresql_config, redis_config, snowflake_config, small_test_table):
1123+
def test_memory_usage_comparison(self, postgresql_config, redis_test_config, snowflake_config, small_test_table):
11181124
"""Compare memory usage patterns across loaders"""
11191125
try:
11201126
import psutil
@@ -1141,7 +1147,7 @@ def test_memory_usage_comparison(self, postgresql_config, redis_config, snowflak
11411147

11421148
# Test Redis memory usage
11431149
initial_memory = process.memory_info().rss
1144-
redis_config_mem = {**redis_config, 'data_structure': 'hash'}
1150+
redis_config_mem = {**redis_test_config, 'data_structure': 'hash'}
11451151
redis_loader = RedisLoader(redis_config_mem)
11461152
with redis_loader:
11471153
redis_loader.load_table(small_test_table, 'memory_test')

0 commit comments

Comments
 (0)