commit 4199c8b2d0d53b7c906943e5f844aafa57b9047d Merge: 925281464 7a0ff5beb Author: Nick Mathewson nickm@torproject.org Date: Tue Sep 18 08:16:42 2018 -0400
Merge remote-tracking branch 'github/bug27073_029'
changes/bug27073 | 4 ++++ src/test/test_threads.c | 30 +++++++++++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-)
diff --cc src/test/test_threads.c index f0a4dd205,448ab2034..2bf502606 --- a/src/test/test_threads.c +++ b/src/test/test_threads.c @@@ -275,14 -283,15 +283,15 @@@ test_threads_conditionvar(void *arg SPIN(); tor_mutex_release(ti->mutex);
- tt_int_op(ti->value, ==, 1337); + tt_int_op(ti->value, OP_EQ, 1337); if (!timeout) { - tt_int_op(ti->n_shutdown, ==, 4); + tt_int_op(ti->n_shutdown, OP_EQ, 4); } else { - tor_sleep_msec(200); - tor_mutex_acquire(ti->mutex); + const int GIVE_UP_AFTER_SEC = 30; + SPIN_UNTIL((ti->n_timeouts == 2 || + time(NULL) >= started_at + GIVE_UP_AFTER_SEC), 10); - tt_int_op(ti->n_shutdown, ==, 2); - tt_int_op(ti->n_timeouts, ==, 2); + tt_int_op(ti->n_shutdown, OP_EQ, 2); + tt_int_op(ti->n_timeouts, OP_EQ, 2); tor_mutex_release(ti->mutex); }