@@ -56,6 +56,7 @@ def create_old_format_data(session_id: str, namespace: str) -> dict:
5656@pytest .fixture
5757async def cleanup_working_memory_keys (async_redis_client ):
5858 """Clean up all working memory keys before and after test."""
59+
5960 async def cleanup ():
6061 cursor = 0
6162 deleted = 0
@@ -118,7 +119,7 @@ async def test_startup_scan_performance(
118119 print (f"✅ Created { KEY_COUNT :,} keys in { creation_time :.2f} s" )
119120
120121 # Benchmark startup scan (with early exit)
121- print (f "\n 📊 Benchmarking startup scan (early exit on first string key)..." )
122+ print ("\n 📊 Benchmarking startup scan (early exit on first string key)..." )
122123 reset_migration_status ()
123124
124125 start = time .perf_counter ()
@@ -251,10 +252,12 @@ async def test_worst_case_single_string_key_at_end(
251252 await async_redis_client .set (string_key , json .dumps (string_data ))
252253
253254 creation_time = time .perf_counter () - start
254- print (f"✅ Created { KEY_COUNT :,} JSON keys + 1 string key in { creation_time :.2f} s" )
255+ print (
256+ f"✅ Created { KEY_COUNT :,} JSON keys + 1 string key in { creation_time :.2f} s"
257+ )
255258
256259 # Benchmark startup scan - must scan all keys to find the string one
257- print (f "\n 📊 Benchmarking startup scan (worst case - string key at end)..." )
260+ print ("\n 📊 Benchmarking startup scan (worst case - string key at end)..." )
258261 reset_migration_status ()
259262
260263 start = time .perf_counter ()
@@ -297,7 +300,7 @@ async def test_migration_script_performance(
297300 print (f"✅ Created { KEY_COUNT :,} string keys in { creation_time :.2f} s" )
298301
299302 # Benchmark migration (simulating what the CLI does)
300- print (f "\n 📊 Benchmarking pipelined migration..." )
303+ print ("\n 📊 Benchmarking pipelined migration..." )
301304 migrate_start = time .perf_counter ()
302305
303306 # Scan and collect string keys
@@ -313,7 +316,7 @@ async def test_migration_script_performance(
313316 pipe .type (key )
314317 types = await pipe .execute ()
315318
316- for key , key_type in zip (keys , types ):
319+ for key , key_type in zip (keys , types , strict = False ):
317320 if isinstance (key_type , bytes ):
318321 key_type = key_type .decode ("utf-8" )
319322 if key_type == "string" :
@@ -323,7 +326,9 @@ async def test_migration_script_performance(
323326 break
324327
325328 scan_time = time .perf_counter () - migrate_start
326- print (f" Scan completed in { scan_time :.2f} s ({ len (string_keys ):,} string keys)" )
329+ print (
330+ f" Scan completed in { scan_time :.2f} s ({ len (string_keys ):,} string keys)"
331+ )
327332
328333 # Migrate in batches
329334 migrated = 0
@@ -338,7 +343,7 @@ async def test_migration_script_performance(
338343
339344 # Parse and migrate
340345 write_pipe = async_redis_client .pipeline ()
341- for key , string_data in zip (batch_keys , string_data_list ):
346+ for key , string_data in zip (batch_keys , string_data_list , strict = False ):
342347 if string_data is None :
343348 continue
344349 if isinstance (string_data , bytes ):
@@ -352,7 +357,9 @@ async def test_migration_script_performance(
352357
353358 if migrated % 100000 == 0 :
354359 elapsed = time .perf_counter () - migrate_start
355- print (f" Migrated { migrated :,} keys ({ migrated / elapsed :,.0f} keys/sec)" )
360+ print (
361+ f" Migrated { migrated :,} keys ({ migrated / elapsed :,.0f} keys/sec)"
362+ )
356363
357364 migrate_time = time .perf_counter () - migrate_start
358365 rate = migrated / migrate_time
@@ -369,4 +376,3 @@ async def test_migration_script_performance(
369376 if isinstance (key_type , bytes ):
370377 key_type = key_type .decode ("utf-8" )
371378 assert key_type == "ReJSON-RL" , f"Expected ReJSON-RL, got { key_type } "
372-
0 commit comments