MCPcopy Create free account
hub / github.com/erans/pgsqlite / test_buffer_cleanup

Function test_buffer_cleanup

src/protocol/buffer_pool.rs:480–501  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

478
479 #[test]
480 fn test_buffer_cleanup() {
481 let config = BufferPoolConfig {
482 cleanup_interval: Duration::from_millis(50),
483 ..Default::default()
484 };
485 let pool = BufferPool::with_config(config);
486
487 // Add some buffers
488 {
489 let _b1 = pool.get_buffer();
490 let _b2 = pool.get_buffer();
491 }
492
493 // Wait for cleanup interval
494 thread::sleep(Duration::from_millis(100));
495
496 // Force cleanup
497 pool.cleanup();
498
499 let stats = pool.get_stats();
500 assert!(stats.last_cleanup.is_some());
501 }
502
503 #[test]
504 fn test_pooled_bytes_mut_operations() {

Callers

nothing calls this directly

Calls 3

get_bufferMethod · 0.80
cleanupMethod · 0.45
get_statsMethod · 0.45

Tested by

no test coverage detected