summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorPete Bentley <prb@google.com>2020-02-18 14:59:42 +0000
committerPete Bentley <prb@google.com>2020-02-20 12:40:04 +0000
commit627cf9a975093875755f3d25ba22119d2b2e29c8 (patch)
treef0982863b2eb95e614e0dc35e5dc568957733555 /annotations/generate_annotated_java_files.py
parent46641b982b48c7ec11466cd7dbfe76de6c375a66 (diff)
Make ServerSocketChannelTest.test_bind_loopback more tolerant.
This test is designed to ensure that a server bound to a loopback address is not reachable via an external IP address. However it could receive false positives if some other server was bound to the same port on an external IP. This change ensures that the test only fails only if its own server socket is reached via an external address. If a different server on an external IP is reached then the test passes but does not re-test that external IP. In practice such port collisions happen very infrequently (approx once per month in continuous CTS tests) so there is a very low chance of the test passing more than once if it should be failing. Even though this change adds a latch to synchronise the threads, there is still a small window where a client connect can arrive and get closed between the latch being released and the server calling accept(). This is mitigated by adding a listen backlog to the bind() call however there is still a very low probability that this test will incorrectly pass if this happens. Also convert to JUnit 4 and misc tidy-ups. Fixes: 148476993 Test: atest --iterations 200 libcore.java.nio.channels.ServerSocketChannelTest Change-Id: I8cad7a2ede549184aff399690c6484da9d12929e
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions