diff --git a/env/env_test.cc b/env/env_test.cc index 8023b9d3d88..69807a81b61 100644 --- a/env/env_test.cc +++ b/env/env_test.cc @@ -125,7 +125,7 @@ static void SetBool(void* ptr) { reinterpret_cast*>(ptr)->store(true); } -TEST_F(EnvPosixTest, RunImmediately) { +TEST_F(EnvPosixTest, DISABLED_RunImmediately) { for (int pri = Env::BOTTOM; pri < Env::TOTAL; ++pri) { std::atomic called(false); env_->SetBackgroundThreads(1, static_cast(pri)); @@ -135,6 +135,13 @@ TEST_F(EnvPosixTest, RunImmediately) { } } +TEST_F(EnvPosixTest, RunEventually) { + std::atomic called(false); + env_->StartThread(&SetBool, &called); + env_->WaitForJoin(); + ASSERT_TRUE(called.load()); +} + #ifdef OS_WIN TEST_F(EnvPosixTest, AreFilesSame) { {