Intermittent test failures for hs_service/service_intro_point
weasel and teor both noted this. I've also experienced this test failing about 1 out of 30 or so times on my development laptop.
10:32 weasel+ | 10:28:33 hs_service/service_intro_point: [forking]
10:32 weasel+ | 10:28:33 FAIL ../src/test/test_hs_service.c:420: assert(ip->time_to_expire OP_GE now + INTRO_POINT_LIFETIME_MIN_SECONDS + 5): 1520483305 vs 1520483309
10:32 weasel+ | 10:28:33 [service_intro_point FAILED]
10:32 weasel+ | https://jenkins.torproject.org/job/tor-debian-0.3.2-nightly-binaries/ARCHITECTURE=i386,SUITE=buster/179/console
10:32 weasel+ | maybe I'm imagining or misattributing things, but hasn't this test ALWAYS been buggy?
10:33 teor4 | I remember it being an issue before. Probably one for asn or dgoulet
It's because there is a hardcoded time_t
that uses the real system time and then later the test expects an HS intro point to have been established within 5 seconds of real clock time.
I'm going to do the stupid fix of increasing it to 500 seconds. Possibly in the future there should be a more elaborate solution involving mocking the time()
function by passing in a function pointer to its implementation into the functions being tested?