Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#19465 closed defect (duplicate)

Rencache unit test can fail on very slow system

Reported by: dgoulet Owned by: dgoulet
Priority: Medium Milestone: Tor: 0.2.9.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: test
Cc: Actual Points:
Parent ID: Points: 0.1
Reviewer: Sponsor:


The test uses a time in the "future" that is the maximum acceptable skew clock plus 10 seconds:

static const int TIME_IN_THE_FUTURE = REND_CACHE_MAX_SKEW + 10;

When using this time for a descriptor and trying to store it in the cache, we should have an error (expected) since it's too far away in the future thus rejected. However, on very slow system such as armel, we've sometime noticed test failure because it would take more than 10 seconds to reach the check in rendcache.c using the store function:

if (parsed->timestamp > now + REND_CACHE_MAX_SKEW) {
  goto err

Which results in a success if we take more than 10 seconds to get there.

This has been reported by weasel and he tested a patch to increase that extra time to 60 seconds which seems to fix the issue:

OK: 1122; FAIL: 0

Branch coming up.

Child Tickets

Change History (6)

comment:1 Changed 4 years ago by dgoulet

Status: newneeds_review

See branch: bug19465_029_01

comment:2 Changed 4 years ago by dgoulet

Status: needs_reviewmerge_ready

comment:3 Changed 4 years ago by cypherpunks

This is related to #19261?

comment:4 in reply to:  3 Changed 4 years ago by dgoulet

Resolution: duplicate
Status: merge_readyclosed

Replying to cypherpunks:

This is related to #19261?

Oh indeed, you are right... marking this one as duplicate, I'll fix the commit and push it for the other ticket. Thanks!

comment:5 Changed 4 years ago by nickm

merged that, but in general, it's usually a good idea to try to design things so that the unit tests are not dependent on how long they take to run.

comment:6 Changed 4 years ago by dgoulet

It was merged while typing the previous comment so I'll close #19261 as "resolved". Epic timing :).

Note: See TracTickets for help on using tickets.