#25995 closed defect (fixed)

Use a deterministic PRNG in test_circuit_timeout() for predictable coverage.

Reported by: nickm Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.4.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-ci, tor-tests-coverage, tor-tests-unit
Cc: mikeperry Actual Points:
Parent ID: #25908 Points:
Reviewer: mikeperry Sponsor: Sponsor3-can


The test coverage from test_circuit_timeout() is nondeterministic, because the function deliberately creates random samples and passes them to the circuitstats module.

I propose that for this function, we replace the RNG with a mocked replacement.

Child Tickets

Change History (5)

comment:1 Changed 20 months ago by nickm

Cc: mikeperry added
Status: assignedneeds_review

branch is ticket25955; PR is https://github.com/torproject/tor/pull/74

Adding mikeperry to cc as the test's author, who may hate what I am proposing to do with this. :)

comment:2 Changed 20 months ago by mikeperry

Reviewer: mikeperry

comment:3 Changed 20 months ago by nickm

Sponsor: Sponsor3-can

comment:4 Changed 20 months ago by mikeperry

Status: needs_reviewmerge_ready

This looks legit. Thanks for this!

comment:5 Changed 20 months ago by nickm

Resolution: fixed
Status: merge_readyclosed

Ok, merged!

Note: See TracTickets for help on using tickets.