]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge remote-tracking branch 'github/bug27073_029'
authorNick Mathewson <nickm@torproject.org>
Tue, 18 Sep 2018 12:16:42 +0000 (08:16 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 18 Sep 2018 12:16:42 +0000 (08:16 -0400)
1  2 
src/test/test_threads.c

index f0a4dd2057e4a681382415b15340b8ab496989d0,448ab2034bcb4aa2e531de914a26965392ef52aa..2bf5026061845f6d20994897d63b846094fffbfb
@@@ -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);
    }