net-test: leak_test - fix a missing close()

*sometimes* (rarely) we see the following:

/usr/lib/python3.9/threading.py:896: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('::1', 44185, 0, 0)>
  del self._target, self._args, self._kwargs
Object allocated at (most recent call last):
  File "/usr/lib/python3.9/unittest/main.py", lineno 271
    self.result = testRunner.run(self.test)
  File "/usr/lib/python3.9/unittest/runner.py", lineno 176
    test(result)
  File "/usr/lib/python3.9/unittest/suite.py", lineno 84
    return self.run(*args, **kwds)
  File "/usr/lib/python3.9/unittest/suite.py", lineno 122
    test(result)
  File "/usr/lib/python3.9/unittest/suite.py", lineno 84
    return self.run(*args, **kwds)
  File "/usr/lib/python3.9/unittest/suite.py", lineno 122
    test(result)
  File "/usr/lib/python3.9/unittest/case.py", lineno 653
    return self.run(*args, **kwds)
  File "/usr/lib/python3.9/unittest/case.py", lineno 593
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.9/unittest/case.py", lineno 550
    method()
  File "/host/mnt/zoom/maze/aosp-tests/net/test/leak_test.py", lineno 30
    s = socket(AF_INET6, SOCK_DGRAM, 0)

hopefully, this will fix it...

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I534806aa8bff8d79eba3e05bb900d4664a52db0f
1 file changed
tree: bc7bd7c388f9804a8989c789ce0f0d23261350bc
  1. net/
  2. test_mappings/
  3. METADATA
  4. OWNERS