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
main
agiardullo 9 years ago
parent a2422f0533
commit 51adc5457a
  1. 2
      db/fault_injection_test.cc

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

Loading…
Cancel
Save