Skip to content

Commit 08f6c32

Browse files
committed
more time margin for Windows tests
1 parent 25ef945 commit 08f6c32

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

tests/gtest_parallel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,10 @@ TEST(Parallel, PauseWithRetry)
589589
const int margin_msec = 10;
590590
#endif
591591

592-
// the whole process should take about 300 milliseconds
593-
ASSERT_LE( toMsec(t2-t1) - 300, margin_msec );
594592
// the second branch with the RetryUntilSuccessful should take about 150 ms
595593
ASSERT_LE( toMsec(done_time-t1) - 150, margin_msec );
594+
// the whole process should take about 300 milliseconds
595+
ASSERT_LE( toMsec(t2-t1) - 300, margin_msec*2 );
596596
}
597597

598598

tests/gtest_sequence.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,14 @@ TEST_F(SequenceTripleActionTest, TripleAction)
239239
{
240240
using namespace BT;
241241
using namespace std::chrono;
242-
const auto timeout = system_clock::now() + milliseconds(650);
242+
243+
#ifdef WIN32
244+
const int margin_msec = 60;
245+
#else
246+
const int margin_msec = 20;
247+
#endif
248+
249+
const auto timeout = system_clock::now() + milliseconds(600 + margin_msec);
243250

244251
action_1.setTime(milliseconds(300));
245252
action_3.setTime(milliseconds(300));
@@ -256,7 +263,7 @@ TEST_F(SequenceTripleActionTest, TripleAction)
256263
// continue until successful
257264
while (state != NodeStatus::SUCCESS && system_clock::now() < timeout)
258265
{
259-
std::this_thread::sleep_for(milliseconds(10));
266+
std::this_thread::sleep_for(milliseconds(1));
260267
state = root.executeTick();
261268
}
262269

0 commit comments

Comments
 (0)