Opened 4 years ago

Closed 2 years ago

#18337 closed defect (fixed)

Remove network dependencies from unit tests

Reported by: teor Owned by: teor
Priority: Low Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Minor Keywords: SponsorS-deferred
Cc: Actual Points:
Parent ID: Points: 1
Reviewer: Sponsor:

Description (last modified by teor)

Some of the new unit tests in 0.2.8 (#17076) seem to be using the resolver on non-existent addresses. This causes them to be slow when the network is up, but fast when it's down (at least on my OS X box).

mikeperry has also complained that they're slow on IRC.

We could mock the address resolution functions to always return NXDOMAIN during these tests to make them faster.

Child Tickets

Change History (14)

comment:1 Changed 4 years ago by teor

Description: modified (diff)

comment:2 Changed 3 years ago by nickm

Milestone: Tor: 0.2.8.x-finalTor: 0.2.9.x-final

These seem like features, or like other stuff unlikely to be possible this month. Bumping them to 0.2.9

comment:3 Changed 3 years ago by isabela

Sponsor: SponsorS-can

comment:4 Changed 3 years ago by nickm

Points: medium

comment:5 Changed 3 years ago by nickm

Keywords: TorCoreTeam201602 removed

comment:6 Changed 3 years ago by isabela

Milestone: Tor: 0.2.9.x-finalTor: 0.2.???

tickets market to be removed from milestone 029

comment:7 Changed 3 years ago by nickm

Keywords: SponsorS-deferred added
Sponsor: SponsorS-can

Remove the SponsorS status from these items, which we already decided to defer from 0.2.9. add the SponsorS-deferred tag instead in case we ever want to remember which ones these were.

comment:8 Changed 3 years ago by teor

Points: medium1
Priority: MediumLow
Severity: NormalMinor

The unit tests seem to run much faster now. I'm not sure we need to do anything more to fix them.

comment:9 Changed 3 years ago by nickm

It's not just the speed -- IMO, it's a bad idea for unit tests to behave in a way that depends on what the network does. If ours have that problem we ought to fix it.

comment:10 Changed 3 years ago by teor

Milestone: Tor: 0.2.???Tor: 0.3.???

Milestone renamed

comment:11 Changed 3 years ago by nickm

Keywords: tor-03-unspecified-201612 added
Milestone: Tor: 0.3.???Tor: unspecified

Finally admitting that 0.3.??? was a euphemism for Tor: unspecified all along.

comment:12 Changed 2 years ago by teor

Summary: Remove network dependencies from 0.2.8 unit testsRemove network dependencies from unit tests

Is this still an issue in 0.3.1?

comment:13 Changed 2 years ago by nickm

Keywords: tor-03-unspecified-201612 removed

Remove an old triaging keyword.

comment:14 Changed 2 years ago by nickm

Resolution: fixed
Status: newclosed

Closing this as fixed, but let's reopen or open a new one if it isn't solved.

Note: See TracTickets for help on using tickets.