Skip to content

Commit a14001a

Browse files
committed
increase and use BOOST_THREAD_TEST_TIME_MS
Working around multiple various msvc timeouts: [00:10:06] testing.capture-output bin.v2\libs\thread\test\async__async_executor_p.test\msvc-14.1\rls\thrdp-wn32\thrd-mlt\async__async_executor_p.run [00:10:06] ====== BEGIN OUTPUT ====== [00:10:06] libs\thread\test\sync\futures\async\async_executor_pass.cpp[168] [00:10:06] libs\thread\test\sync\futures\async\async_executor_pass.cpp[161] 18700 [00:10:06] libs\thread\test\sync\futures\async\async_executor_pass.cpp[195] [00:10:06] libs\thread\test\sync\futures\async\async_executor_pass.cpp[161] 1300 [00:10:06] libs\thread\test\sync\futures\async\async_executor_pass.cpp[222] [00:10:06] libs\thread\test\sync\futures\async\async_executor_pass.cpp(160): test '(now - start).count() < (delay).count()' ('588712300' < '500000000') failed in function '__cdecl check_timer::~check_timer(void)' [00:08:03] testing.capture-output bin.v2\libs\thread\test\async__async_executor_p.test\msvc-12.0\rls\thrdp-wn32\thrd-mlt\async__async_executor_p.run [00:08:03] ====== BEGIN OUTPUT ====== [00:08:03] libs\thread\test\sync\futures\async\async_executor_pass.cpp[167] [00:08:03] libs\thread\test\sync\futures\async\async_executor_pass.cpp(159): test 'now - start < delay' failed in function '__cdecl check_timer::~check_timer(void)' [00:08:03] libs\thread\test\sync\futures\async\async_executor_pass.cpp[160] 671942300 [00:08:03] 1 error detected. [00:11:18] Creating library bin.v2\libs\thread\test\condition_variable_any__wait_for_pred_p.test\msvc-14.2\rls\thrdp-wn32\thrd-mlt\condition_variable_any__wait_for_pred_p.lib and object bin.v2\libs\thread\test\condition_variable_any__wait_for_pred_p.test\msvc-14.2\rls\thrdp-wn32\thrd-mlt\condition_variable_any__wait_for_pred_p.exp [00:11:19] testing.capture-output bin.v2\libs\thread\test\condition_variable_any__wait_for_pred_p.test\msvc-14.2\rls\thrdp-wn32\thrd-mlt\condition_variable_any__wait_for_pred_p.run [00:11:19] ====== BEGIN OUTPUT ====== [00:11:19] libs\thread\test\sync\conditions\condition_variable_any\wait_for_pred_pass.cpp(80): test '(d).count() < (ns(max_diff)).count()' ('359371700' < '350000000') failed in function 'void __cdecl f(void)' [00:16:25] testing.capture-output bin.v2\libs\thread\test\sync_pq_single_thread_p_lib.test\msvc-12.0\rls\thrdp-wn32\thrd-mlt\sync_pq_single_thread_p_lib.run [00:16:25] ====== BEGIN OUTPUT ====== [00:16:25] libs\thread\test\sync\mutual_exclusion\sync_pq\pq_single_thread_pass.cpp(72): test '(d).count() < (ns(max_diff)).count()' ('418238900' < '400000000') failed in function 'void __cdecl test_pull_until(void)' fixup! increase and use BOOST_THREAD_TEST_TIME_MS
1 parent 94b0f81 commit a14001a

4 files changed

Lines changed: 14 additions & 8 deletions

File tree

test/sync/futures/async/async_executor_pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ int main()
175175
boost::this_thread::sleep_for(ms(300));
176176
int res;
177177
{
178-
check_timer timer(ms(500));
178+
check_timer timer(ms(2 * BOOST_THREAD_TEST_TIME_MS));
179179
res = f.get();
180180
}
181181
BOOST_TEST(res == 3);
@@ -201,7 +201,7 @@ int main()
201201
boost::this_thread::sleep_for(ms(300));
202202
int res;
203203
{
204-
check_timer timer(ms(500));
204+
check_timer timer(ms(2 * BOOST_THREAD_TEST_TIME_MS));
205205
res = f.get();
206206
}
207207
BOOST_TEST(res == 3);
@@ -230,7 +230,7 @@ int main()
230230
boost::this_thread::sleep_for(ms(300));
231231
int res;
232232
{
233-
check_timer timer(ms(500));
233+
check_timer timer(ms(2 * BOOST_THREAD_TEST_TIME_MS));
234234
res = f.get();
235235
}
236236
BOOST_TEST(res == 3);

test/test_condition_notify_all.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
#define BOOST_THREAD_VERSION 2
77
#define BOOST_TEST_MODULE Boost.Threads: condition_variable notify_all test suite
8+
#include "timming.hpp"
9+
#undef BOOST_TEST
10+
#undef BOOST_ERROR
811
#include <boost/thread/detail/config.hpp>
912

1013
#include <boost/thread/thread_only.hpp>
@@ -190,11 +193,11 @@ void do_test_notify_all_following_notify_one_wakes_all_threads()
190193
boost::this_thread::sleep(boost::posix_time::milliseconds(200));
191194
multiple_wake_cond.notify_one();
192195
multiple_wake_cond.notify_all();
193-
boost::this_thread::sleep(boost::posix_time::milliseconds(200));
196+
boost::this_thread::sleep(boost::posix_time::milliseconds(BOOST_THREAD_TEST_TIME_MS));
194197

195198
{
196199
boost::unique_lock<boost::mutex> lk(multiple_wake_mutex);
197-
BOOST_CHECK(multiple_wake_count==3);
200+
BOOST_CHECK_EQUAL(multiple_wake_count, (unsigned)3);
198201
}
199202

200203
thread1.join();

test/test_condition_notify_one.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
#define BOOST_TEST_MODULE Boost.Threads: condition_variable notify_one test suite
99

10+
#include "timming.hpp"
11+
#undef BOOST_TEST
12+
#undef BOOST_ERROR
1013
#include <boost/thread/detail/config.hpp>
1114

1215
#include <boost/thread/thread_only.hpp>
@@ -125,11 +128,11 @@ void do_test_multiple_notify_one_calls_wakes_multiple_threads()
125128
boost::this_thread::sleep(boost::posix_time::milliseconds(200));
126129
multiple_wake_cond.notify_one();
127130
multiple_wake_cond.notify_one();
128-
boost::this_thread::sleep(boost::posix_time::milliseconds(200));
131+
boost::this_thread::sleep(boost::posix_time::milliseconds(BOOST_THREAD_TEST_TIME_MS));
129132

130133
{
131134
boost::unique_lock<boost::mutex> lk(multiple_wake_mutex);
132-
BOOST_CHECK(multiple_wake_count==3);
135+
BOOST_CHECK_EQUAL(multiple_wake_count, 3);
133136
}
134137

135138
thread1.join();

test/timming.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define BOOST_THREAD_TEST_TIME_MS 75
1515
#else
1616
// Windows, Cygwin, macOS all need this
17-
#define BOOST_THREAD_TEST_TIME_MS 250
17+
#define BOOST_THREAD_TEST_TIME_MS 500
1818
#endif
1919
#endif
2020

0 commit comments

Comments
 (0)