Unit tests should work offline #2085

Open
opened 2013-09-20 19:20:22 +00:00 by markberger · 3 comments
markberger commented 2013-09-20 19:20:22 +00:00
Owner

I noticed that a handful of unit tests fail when the user isn't connected to the internet. Ideally these unit tests would just skip if there is no internet connection.

[FAIL]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 137, in maybeDeferred
    result = f(*args, **kw)
  File "/home/markberger/code/tahoe-lafs/src/allmydata/util/pollmixin.py", line 49, in _poll
    self.fail("Errors snooped, terminating early")
twisted.trial.unittest.FailTest: Errors snooped, terminating early

allmydata.test.test_keygen.KeyGenService.test_key_gen_service
allmydata.test.test_system.SystemTest.test_filesystem
allmydata.test.test_system.SystemTest.test_mutable
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/markberger/code/tahoe-lafs/support/lib/python2.7/site-packages/foolscap-0.6.4-py2.7.egg/foolscap/pb.py", line 535, in _reactor_running
    return util.get_local_ip_for()
  File "/home/markberger/code/tahoe-lafs/support/lib/python2.7/site-packages/foolscap-0.6.4-py2.7.egg/foolscap/util.py", line 70, in get_local_ip_for
    target_ipaddr = socket.gethostbyname(target)
socket.error: [Errno 110] Connection timed out

allmydata.test.test_keygen.KeyGenService.test_key_gen_service
allmydata.test.test_keygen.KeyGenService.test_key_gen_service
allmydata.test.test_system.SystemTest.test_filesystem
allmydata.test.test_system.SystemTest.test_mutable
===============================================================================
[ERROR]
Traceback (most recent call last):
Failure: twisted.internet.defer.TimeoutError: <allmydata.test.test_runner.RunNode testMethod=test_keygen> (test_keygen) still running at 240.0 secs

allmydata.test.test_runner.RunNode.test_keygen
===============================================================================
[ERROR]
Traceback (most recent call last):
Failure: twisted.trial.util.DirtyReactorAggregateError: Reactor was unclean.
DelayedCalls: (set twisted.internet.base.DelayedCall.debug = True to debug)
<DelayedCall 0x37863f8 [0.00365591049194s] called=0 cancelled=0 LoopingCall<0.01>(RunNode._poll, *(<function _node_has_started at 0x4bd16e0>, 1379704909.620077), **{})()>

allmydata.test.test_runner.RunNode.test_keygen

I noticed that a handful of unit tests fail when the user isn't connected to the internet. Ideally these unit tests would just skip if there is no internet connection. ``` [FAIL] Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 137, in maybeDeferred result = f(*args, **kw) File "/home/markberger/code/tahoe-lafs/src/allmydata/util/pollmixin.py", line 49, in _poll self.fail("Errors snooped, terminating early") twisted.trial.unittest.FailTest: Errors snooped, terminating early allmydata.test.test_keygen.KeyGenService.test_key_gen_service allmydata.test.test_system.SystemTest.test_filesystem allmydata.test.test_system.SystemTest.test_mutable =============================================================================== [ERROR] Traceback (most recent call last): File "/home/markberger/code/tahoe-lafs/support/lib/python2.7/site-packages/foolscap-0.6.4-py2.7.egg/foolscap/pb.py", line 535, in _reactor_running return util.get_local_ip_for() File "/home/markberger/code/tahoe-lafs/support/lib/python2.7/site-packages/foolscap-0.6.4-py2.7.egg/foolscap/util.py", line 70, in get_local_ip_for target_ipaddr = socket.gethostbyname(target) socket.error: [Errno 110] Connection timed out allmydata.test.test_keygen.KeyGenService.test_key_gen_service allmydata.test.test_keygen.KeyGenService.test_key_gen_service allmydata.test.test_system.SystemTest.test_filesystem allmydata.test.test_system.SystemTest.test_mutable =============================================================================== [ERROR] Traceback (most recent call last): Failure: twisted.internet.defer.TimeoutError: <allmydata.test.test_runner.RunNode testMethod=test_keygen> (test_keygen) still running at 240.0 secs allmydata.test.test_runner.RunNode.test_keygen =============================================================================== [ERROR] Traceback (most recent call last): Failure: twisted.trial.util.DirtyReactorAggregateError: Reactor was unclean. DelayedCalls: (set twisted.internet.base.DelayedCall.debug = True to debug) <DelayedCall 0x37863f8 [0.00365591049194s] called=0 cancelled=0 LoopingCall<0.01>(RunNode._poll, *(<function _node_has_started at 0x4bd16e0>, 1379704909.620077), **{})()> allmydata.test.test_runner.RunNode.test_keygen ```
tahoe-lafs added the
dev-infrastructure
normal
defect
1.10.0
labels 2013-09-20 19:20:22 +00:00
tahoe-lafs added this to the undecided milestone 2013-09-20 19:20:22 +00:00
Author
Owner

Replying to markberger:

Ideally these unit tests would just skip if there is no internet connection.

I think the test suite shouldn't ever try to connect to the internet.

Replying to [markberger](/tahoe-lafs/trac-2024-07-25/issues/9558): > Ideally these unit tests would just skip if there is no internet connection. I think the test suite shouldn't ever try to connect to the internet.
zooko commented 2013-09-20 20:47:13 +00:00
Author
Owner

I agree with Leif. By the way, I don't know, off the top of my head, why these tests behave differently when the user isn't connected to the Internet.

I agree with Leif. By the way, I don't know, off the top of my head, why these tests behave differently when the user isn't connected to the Internet.
daira commented 2013-09-21 03:55:33 +00:00
Author
Owner

Replying to [leif]comment:1:

I think the test suite shouldn't ever try to connect to the internet.

+1, although I think the issue here is finding addresses for furl connection hints, rather than actually connecting to anywhere outside the local machine.

Replying to [leif]comment:1: > I think the test suite shouldn't ever try to connect to the internet. +1, although I think the issue here is finding addresses for furl connection hints, rather than actually connecting to anywhere outside the local machine.
tahoe-lafs added
code-network
and removed
dev-infrastructure
labels 2013-09-21 03:59:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac-2024-07-25#2085
No description provided.