Skip to content

Commit

Permalink
Merge pull request #472 from Dronecode/fix-mac-ci
Browse files Browse the repository at this point in the history
core: fix macOS CI
  • Loading branch information
julianoes authored Jul 25, 2018
2 parents b8ab161 + e234fc1 commit 177da68
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/thread_pool_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static Time our_time;

static void run_delayed()
{
our_time.sleep_for(std::chrono::milliseconds(50));
our_time.sleep_for(std::chrono::milliseconds(250));
task_one_ran = true;
}

Expand All @@ -29,9 +29,9 @@ TEST(ThreadPool, SimpleTask)
task_one_ran = false;
tp.enqueue(std::bind(run_delayed));

our_time.sleep_for(std::chrono::milliseconds(25));
our_time.sleep_for(std::chrono::milliseconds(125));
EXPECT_FALSE(task_one_ran);
our_time.sleep_for(std::chrono::milliseconds(50));
our_time.sleep_for(std::chrono::milliseconds(250));
EXPECT_TRUE(task_one_ran);
}

Expand All @@ -51,7 +51,7 @@ TEST(ThreadPool, SimpleTaskWithArgs)

tp.enqueue(std::bind(add_first_to_second, first, std::ref(second)));

our_time.sleep_for(std::chrono::milliseconds(25));
our_time.sleep_for(std::chrono::milliseconds(125));
EXPECT_EQ(second, sum);
}

Expand All @@ -66,7 +66,7 @@ TEST(ThreadPool, LambdaWithArgs)

tp.enqueue([first, &second]() { second += first; });

our_time.sleep_for(std::chrono::milliseconds(25));
our_time.sleep_for(std::chrono::milliseconds(125));
EXPECT_EQ(second, sum);
}

Expand All @@ -82,7 +82,7 @@ TEST(ThreadPool, ManyTasks)
tp.enqueue([&tasks, i]() { tasks[i] = i; });
}

our_time.sleep_for(std::chrono::milliseconds(25));
our_time.sleep_for(std::chrono::milliseconds(125));

for (int i = 0; i < tasks_num; ++i) {
EXPECT_EQ(tasks[i], i);
Expand Down

0 comments on commit 177da68

Please sign in to comment.