@ -168,9 +168,8 @@ void VerifyInitializationOfCompactionJobStats(
void VerifyCompactionJobStats (
void VerifyCompactionJobStats (
const CompactionJobStats & compaction_job_stats ,
const CompactionJobStats & compaction_job_stats ,
const std : : vector < FileMetaData * > & files ,
const std : : vector < FileMetaData * > & files ,
size_t num_output_files ,
size_t num_output_files ) {
uint64_t min_elapsed_time ) {
ASSERT_GE ( compaction_job_stats . elapsed_micros , 0U ) ;
ASSERT_GE ( compaction_job_stats . elapsed_micros , min_elapsed_time ) ;
ASSERT_EQ ( compaction_job_stats . num_input_files , files . size ( ) ) ;
ASSERT_EQ ( compaction_job_stats . num_input_files , files . size ( ) ) ;
ASSERT_EQ ( compaction_job_stats . num_output_files , num_output_files ) ;
ASSERT_EQ ( compaction_job_stats . num_output_files , num_output_files ) ;
}
}
@ -209,7 +208,6 @@ TEST_F(CompactionJobTest, Simple) {
std : : move ( yield_callback ) , & event_logger , false ,
std : : move ( yield_callback ) , & event_logger , false ,
db_name , & compaction_job_stats ) ;
db_name , & compaction_job_stats ) ;
auto start_micros = Env : : Default ( ) - > NowMicros ( ) ;
VerifyInitializationOfCompactionJobStats ( compaction_job_stats ) ;
VerifyInitializationOfCompactionJobStats ( compaction_job_stats ) ;
compaction_job . Prepare ( ) ;
compaction_job . Prepare ( ) ;
@ -223,7 +221,7 @@ TEST_F(CompactionJobTest, Simple) {
VerifyCompactionJobStats (
VerifyCompactionJobStats (
compaction_job_stats ,
compaction_job_stats ,
files , 1 , ( Env : : Default ( ) - > NowMicros ( ) - start_micros ) / 2 ) ;
files , 1 ) ;
mock_table_factory_ - > AssertLatestFile ( expected_results ) ;
mock_table_factory_ - > AssertLatestFile ( expected_results ) ;
ASSERT_EQ ( yield_callback_called , 20000 ) ;
ASSERT_EQ ( yield_callback_called , 20000 ) ;