Raised IndexError when choosing exits in test network
Created by: juga0
Running sbws 09691a0f with python 3.5.3 in the test network got this traceback:
i = self._randbelow(len(seq))
File " /path/.virtualenvs/simplebwscanner3/lib/python3.5/random.py", line 239, in _randbelow
r = getrandbits(k) # 0 <= r < 2**k
File " /path/.virtualenvs/simplebwscanner3/lib/python3.5/random.py", line 663, in getrandbits
raise ValueError('number of bits must be greater than zero')
ValueError: number of bits must be greater than zero
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File " /path/simple-bw-scanner/sbws/core/scanner.py", line 257, in dispatch_worker_thread
return measure_relay(*a, **kw)
File " /path/simple-bw-scanner/sbws/core/scanner.py", line 172, in measure_relay
dest = destinations.next()
File " /path/simple-bw-scanner/sbws/lib/destination.py", line 245, in next
self._perform_usability_test()
File " /path/simple-bw-scanner/sbws/lib/destination.py", line 193, in _perform_usability_test
exit = self._rng.choice(exits)
File " /path/.virtualenvs/simplebwscanner3/lib/python3.5/random.py", line 264, in choice
raise IndexError('Cannot choose from an empty sequence')
IndexError: Cannot choose from an empty sequence
[2018-06-23 13:55:54,511] [sbws.core.scanner] [ERROR] Unhandled exception caught while measuring foo: <class 'IndexError'> Cannot choose from an empty sequence
It seems we should check that there's at least 1 exit