Closed cmarxer closed 6 years ago
Running to many tests. Port selection is already randomized, which doesn't seem to be sufficient. must be changed in some way. OS keeps ports to long open.
I think the solution here is to let the OS choose the port, I start changing the tests to do so.
seems to fix that bug.
Now occurs less often, but still:
======================================================================
ERROR: test_fetch_small_data (PiCN.ProgramLibs.ICNDataRepository.test.test_ICNDataRepository.test_ICNDataRepository)
Test fetching a small data object with little chunking
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/claudio/software/PiCN/PiCN/ProgramLibs/ICNDataRepository/test/test_ICNDataRepository.py", line 35, in setUp
self.fetch = Fetch("127.0.0.1", self.repo_port)
File "/home/claudio/software/PiCN/PiCN/ProgramLibs/Fetch/Fetch.py", line 28, in __init__
self.linklayer = UDP4LinkLayer(randint(10000, 64000), debug_level=debug_level)
File "/home/claudio/software/PiCN/PiCN/Layers/LinkLayer/UDP4LinkLayer.py", line 25, in __init__
self.sock.bind(("0.0.0.0", self._port))
OSError: [Errno 98] Address already in use
Still got this on this point:
ERROR: test_fetching_content_from_second_repo_after_nack (PiCN.ProgramLibs.Fetch.test.test_Fetch.test_Fetch) Test sending an interest to forwarder with no matching content, choose second route to fetch content
Traceback (most recent call last): File "/Users/christopherscherb/SourceCode/PiCN/PiCN/ProgramLibs/Fetch/test/test_Fetch.py", line 36, in setUp self.ICNRepo: ICNDataRepository = ICNDataRepository("/tmp/repo_unit_test", Name("/test/data"), port=0) File "/Users/christopherscherb/SourceCode/PiCN/PiCN/ProgramLibs/ICNDataRepository/ICNDataRepository.py", line 79, in init repo_prfx=prefix, debug_level=debug_level) File "/Users/christopherscherb/SourceCode/PiCN/PiCN/Mgmt/Mgmt.py", line 34, in init self.mgmt_sock.bind(("127.0.0.1", self._port)) OSError: [Errno 48] Address already in use
Doesn't occur any more.
Occasionally, a software test fails due to OS Error "Address already in use":