Breif description of the problem:
The compaction test calculates the directory size but not considers the KvStore's writer may not sync the file buffer data into disk, so the dir_size() returns 0, what leads to the condition new_size > current_size is not satisfied, eventually this lead to pass the test. And the compaction test should test whether the open() method can calculate the uncompacted data size.
What is changed and how it works?
Check List
Tests
Manual test (add detailed scripts or steps below)
Fix and then run the compaction test, and check whether the new_size is correct (greater than 0)
What problem does this PR solve?
KvStore
's writer may not sync the file buffer data into disk, so thedir_size()
returns 0, what leads to the conditionnew_size > current_size
is not satisfied, eventually this lead to pass the test. And the compaction test should test whether theopen()
method can calculate the uncompacted data size.What is changed and how it works?
Check List
Tests
new_size
is correct (greater than 0)Side effects