Opened 2 months ago

Closed 5 weeks ago

#27810 closed defect (fixed)

hs_service/helper_functions test seems unreliable on slow systems

Reported by: nickm Owned by: dgoulet
Priority: Very High Milestone: Tor: 0.3.4.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-test, tor-hs, 035-must
Cc: catalyst Actual Points:
Parent ID: Points:
Reviewer: mikeperry Sponsor:

Description (last modified by nickm)

Hi! I've seen this test failure a few times on Travis:

hs_service/helper_functions: [forking] 
  FAIL src/test/test_hs_service.c:837: assert(ip->time_to_expire OP_GE now + INTRO_POINT_LIFETIME_MIN_SECONDS): 1537602275 vs 1537602297
  [helper_functions FAILED]

It seems to happen intermittently, so I think it might be one of those things where a slow-running machine fails the test because of the unexpected passage of time.

Is it possible to mock time here?

Child Tickets

Change History (11)

comment:1 Changed 2 months ago by nickm

Description: modified (diff)

comment:2 Changed 2 months ago by dgoulet

Keywords: tor-test tor-hs added
Owner: set to dgoulet
Status: newaccepted

To fix this, we would need to MOCK approx_time() since the time_to_expire of the IP is set as follow:

    ip->time_to_expire = approx_time() +
      crypto_rand_int_range(intro_point_min_lifetime,intro_point_max_lifetime);

comment:3 Changed 2 months ago by dgoulet

Status: acceptedneeds_review

Branch: ticket27810_035_01

I've looked at the other checks of time_to_expire and I believe they are all OK.

comment:4 Changed 2 months ago by dgoulet

Reviewer: mikeperry

comment:5 Changed 7 weeks ago by nickm

Keywords: 035-must added

Add the 035-must tag to some assertion failures, hangs, ci-blockers, etc.

comment:6 Changed 7 weeks ago by nickm

Priority: MediumVery High

Mark all 035-must tickets as "very high"

comment:7 Changed 6 weeks ago by catalyst

Cc: catalyst added

comment:9 Changed 5 weeks ago by mikeperry

Tests pass; lgtm!

comment:10 Changed 5 weeks ago by mikeperry

Status: needs_reviewmerge_ready

comment:11 Changed 5 weeks ago by nickm

Milestone: Tor: 0.3.5.x-finalTor: 0.3.4.x-final
Resolution: fixed
Status: merge_readyclosed

cherry-picked to 0.3.4 and merged forward.

Note: See TracTickets for help on using tickets.