|
9 | 9 |
|
10 | 10 | @threading_helper.requires_working_threading() |
11 | 11 | class TestSocketTimeoutRaces(unittest.TestCase): |
12 | | - # gh-153935: the socket timeout was read/written non-atomically, so reading |
13 | | - # it (gettimeout()/getblocking() or during a socket operation) raced with |
14 | | - # settimeout()/setblocking() on the same socket. |
| 12 | + # gh-153852: the socket timeout was read/written non-atomically, so reading |
| 13 | + # it with gettimeout()/getblocking() raced with settimeout()/setblocking() |
| 14 | + # on the same socket. |
15 | 15 |
|
16 | 16 | def new_socket(self): |
17 | 17 | s = socket.socket() |
@@ -41,44 +41,6 @@ def test_getblocking_vs_settimeout(self): |
41 | 41 | s = self.new_socket() |
42 | 42 | self.check_race(s.getblocking, lambda: s.settimeout(0)) |
43 | 43 |
|
44 | | - def test_operation_vs_settimeout(self): |
45 | | - a, b = socket.socketpair() |
46 | | - self.addCleanup(a.close) |
47 | | - self.addCleanup(b.close) |
48 | | - a.setblocking(False) |
49 | | - |
50 | | - def recv(): |
51 | | - try: |
52 | | - a.recv(64) |
53 | | - except OSError: |
54 | | - pass |
55 | | - |
56 | | - self.check_race(recv, lambda: a.settimeout(0)) |
57 | | - |
58 | | - def test_sendall_vs_settimeout(self): |
59 | | - a, b = socket.socketpair() |
60 | | - self.addCleanup(a.close) |
61 | | - self.addCleanup(b.close) |
62 | | - a.setblocking(False) |
63 | | - |
64 | | - def sendall(): |
65 | | - try: |
66 | | - a.sendall(b"x" * 64) |
67 | | - except OSError: |
68 | | - pass |
69 | | - |
70 | | - self.check_race(sendall, lambda: a.settimeout(0)) |
71 | | - |
72 | | - def test_connect_vs_settimeout(self): |
73 | | - lsock = socket.socket() |
74 | | - lsock.bind(("127.0.0.1", 0)) |
75 | | - lsock.listen() |
76 | | - self.addCleanup(lsock.close) |
77 | | - addr = lsock.getsockname() |
78 | | - s = self.new_socket() |
79 | | - |
80 | | - self.check_race(lambda: s.connect_ex(addr), lambda: s.settimeout(0)) |
81 | | - |
82 | 44 |
|
83 | 45 | if __name__ == "__main__": |
84 | 46 | unittest.main() |
0 commit comments