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

Function test_stress_rapid_operations

ci/tests/test_fingerprint_integration.py:220–246  ·  view source on GitHub ↗

Stress test with rapid cache operations.

()

Source from the content-addressed store, hash-verified

218
219
220def test_stress_rapid_operations() -> None:
221 """Stress test with rapid cache operations."""
222 with tempfile.TemporaryDirectory() as temp_dir:
223 temp_path = Path(temp_dir)
224 test_dir = temp_path / "test_files"
225 cache_dir = temp_path / ".cache"
226 cache_dir.mkdir(exist_ok=True)
227
228 create_test_files(test_dir, 10)
229 include = ["**/*.txt"]
230 root = str(test_dir)
231
232 # TwoLayerFingerprintCache stress
233 two_layer = TwoLayerFingerprintCache(cache_dir, "stress_two_layer")
234 for _ in range(10):
235 needs_update = two_layer.check_needs_update(include=include, root=root)
236 if needs_update:
237 two_layer.mark_success()
238 two_layer.invalidate()
239
240 # HashFingerprintCache stress
241 hash_cache = HashFingerprintCache(cache_dir, "stress_hash")
242 for _ in range(10):
243 needs_update = hash_cache.check_needs_update(include=include, root=root)
244 if needs_update:
245 hash_cache.mark_success()
246 hash_cache.invalidate()
247
248
249def test_stress_large_files() -> None:

Callers

nothing calls this directly

Calls 9

check_needs_updateMethod · 0.95
mark_successMethod · 0.95
invalidateMethod · 0.95
check_needs_updateMethod · 0.95
mark_successMethod · 0.95
invalidateMethod · 0.95
create_test_filesFunction · 0.70

Tested by

no test coverage detected