diff options
author | Qi Wang <interwq@gwu.edu> | 2017-05-26 20:51:55 (GMT) |
---|---|---|
committer | Qi Wang <interwq@gmail.com> | 2017-05-27 04:15:15 (GMT) |
commit | 49505e558baade576bab40cbd3b9fdaa61ba77d2 (patch) | |
tree | 0d28062e6b03ac8ebf98d820750a81585014f3a0 | |
parent | b86d271cbfc7bdeb077b663a2e526cf19f7c1840 (diff) | |
download | jemalloc-49505e558baade576bab40cbd3b9fdaa61ba77d2.zip jemalloc-49505e558baade576bab40cbd3b9fdaa61ba77d2.tar.gz jemalloc-49505e558baade576bab40cbd3b9fdaa61ba77d2.tar.bz2 |
Make test/unit/background_thread not flaky.
-rw-r--r-- | test/unit/background_thread.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/unit/background_thread.c b/test/unit/background_thread.c index 05089c2..81f8aee 100644 --- a/test/unit/background_thread.c +++ b/test/unit/background_thread.c @@ -80,6 +80,8 @@ TEST_BEGIN(test_background_thread_running) { test_repeat_background_thread_ctl(false); test_switch_background_thread_ctl(true); + assert_b_eq(info->started, true, + "Background_thread did not start.\n"); nstime_t start, now; nstime_init(&start, 0); @@ -99,9 +101,9 @@ TEST_BEGIN(test_background_thread_running) { nstime_init(&now, 0); nstime_update(&now); nstime_subtract(&now, &start); - assert_u64_lt(nstime_sec(&now), 10, - "Background threads did not run for 10 seconds."); - usleep(10000); + assert_u64_lt(nstime_sec(&now), 1000, + "Background threads did not run for 1000 seconds."); + sleep(1); } test_switch_background_thread_ctl(false); #endif |