MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_concurrent_cache_access

Function test_concurrent_cache_access

ci/test_all_lint_caches_stress.py:379–407  ·  view source on GitHub ↗

Test concurrent cache access doesn't break anything.

(test: CacheLintStressTest)

Source from the content-addressed store, hash-verified

377
378
379def test_concurrent_cache_access(test: CacheLintStressTest) -> None:
380 """Test concurrent cache access doesn't break anything."""
381 print("\n📋 TEST 8: Concurrent Cache Access")
382 print("-" * 70)
383
384 # Run 3 concurrent cache checks
385 result_queue: multiprocessing.Queue[tuple[str, Any]] = multiprocessing.Queue()
386 processes: list[multiprocessing.Process] = []
387
388 for i in range(3):
389 p = multiprocessing.Process(
390 target=_concurrent_cache_check, args=("python", result_queue)
391 )
392 p.start()
393 processes.append(p)
394
395 # Wait for all
396 for p in processes:
397 p.join(timeout=15)
398
399 # Check results
400 results: list[tuple[str, Any]] = []
401 while not result_queue.empty():
402 results.append(result_queue.get())
403
404 if len(results) >= 2:
405 test.pass_test("Concurrent cache access completed without errors")
406 else:
407 test.fail_test("Concurrent cache access", f"Only {len(results)}/3 completed")
408
409
410def main() -> int:

Callers 1

mainFunction · 0.85

Calls 7

printFunction · 0.50
startMethod · 0.45
appendMethod · 0.45
emptyMethod · 0.45
getMethod · 0.45
pass_testMethod · 0.45
fail_testMethod · 0.45

Tested by

no test coverage detected