fix sporadic failure in fault_injection_test

Summary: Need to make sure the background task gets scheduled before it goes out of scope.

Test Plan: ran test.  Will see if sporadic valgrind failures go away.

Reviewers: kradhakrishnan

Reviewed By: kradhakrishnan

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D52575
This commit is contained in:
agiardullo 2016-01-05 17:56:29 -08:00
parent a2422f0533
commit 51adc5457a

View File

@ -783,6 +783,7 @@ TEST_P(FaultInjectionTest, WriteOptionSyncTest) {
// Block the job queue to prevent flush job from running.
env_->Schedule(&test::SleepingBackgroundTask::DoSleepTask, &sleeping_task_low,
Env::Priority::HIGH);
sleeping_task_low.WaitUntilSleeping();
WriteOptions write_options;
write_options.sync = false;
@ -866,6 +867,7 @@ TEST_P(FaultInjectionTest, ManualLogSyncTest) {
// Block the job queue to prevent flush job from running.
env_->Schedule(&test::SleepingBackgroundTask::DoSleepTask, &sleeping_task_low,
Env::Priority::HIGH);
sleeping_task_low.WaitUntilSleeping();
WriteOptions write_options;
write_options.sync = false;