TestLazyPersistFiles#testLazyPersistBlocksAreSaved verifies that the memory block is saved in lazy persist directory after some sleep with the following code.
// Sleep for a short time to allow the lazy writer thread to do its job Thread.sleep(6 * LAZY_WRITER_INTERVAL_SEC * 1000);
However, the sleep only guarantees an async lazy persist task is scheduled. The task running on a per volume thread pool thread can take longer to finish persisting. It will be more deterministic to wait the pending lazy persist task count reduce to 0 before verifying the block file exist in lazy persist dir.