Opened 3 years ago

Last modified 2 years ago

#20617 new enhancement

Write a unit test abstraction for tests that need to be repeated multiple times to prove failure — at Initial Version

Reported by: teor Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: test, unit-test, backend
Cc: Actual Points:
Parent ID: Points: 2
Reviewer: Sponsor:


Some unit tests succeed at random with a certain probability, so we need to repeat them a number of times until the failure rate is acceptable.

Typically, we make sure the failure rate is less than the memory bit flip rate.

But we could standardise this, by taking the following inputs:

  • test function with success/fail return value,
  • the probability of success regardless of whether the code actually works,
  • the desired overall probability of failure by chance (for example, the bit flip rate).

The abstraction would then repeat the test enough times to make sure the failure rate is less than the bit flip rate.

We might also want to check that the distribution of returned values is uniform, but I think that's a separate (and more complex) ticket.

Child Tickets

Change History (0)

Note: See TracTickets for help on using tickets.