[tor-bugs] #21799 [Core Tor/Tor]: Unittest fail: FAIL ../tor/src/test/test_entrynodes.c:618: assert(smartlist_len(gs_br->sampled_entry_guards) OP_EQ 2): 1 vs 2

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Mar 22 11:15:24 UTC 2017


#21799: Unittest fail: FAIL ../tor/src/test/test_entrynodes.c:618:
assert(smartlist_len(gs_br->sampled_entry_guards) OP_EQ 2): 1 vs 2
------------------------------+--------------------------------
     Reporter:  asn           |      Owner:
         Type:  defect        |     Status:  new
     Priority:  High          |  Milestone:  Tor: 0.3.0.x-final
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:  tor-guard
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+--------------------------------
 {{{
 entrynodes/parse_from_state_full: [forking]
   FAIL ../tor/src/test/test_entrynodes.c:618:
 assert(smartlist_len(gs_br->sampled_entry_guards) OP_EQ 2): 1 vs 2
   [parse_from_state_full FAILED]
 }}}

 The entry nodes unittests are failing because of an expired timestmap.
 Specifically:
 {{{
   "Guard in=bridges rsa_id=5800000000000000000000000000000000000000 "
     "bridge_addr=37.218.246.143:28366 "
     "sampled_on=2016-11-18T15:07:34 sampled_by=0.3.0.0-alpha-dev
 listed=1\n";
 }}}

 since it was sampled over 120 days ago we get:
 {{{
 Mar 22 11:44:29.227 [info] sampled_guards_update_from_consensus():
 Removing sampled guard          $5800000000000000000000000000000000000000
 ($5800000000000000000000000000000000000000): it was sampled over 120 days
 ago, but never
              confirmed.
 }}}

 The fix is to use `get_yesterday_date_str()` instead of a hardcoded date.
 It's not trivial tho because in the end the test tries to be smart and
 predict how the state is gonna be modified, so we need to also work on the
 `tt_str_op(joined, OP_EQ, ...)` part.

 Also, there seem to be more unittests with hardcoded 2016 dates. We should
 see if those are ticking bombs as well.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/21799>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list