Skip to content

Commit 3055bce

Browse files
committed
merge
1 parent 7491e7f commit 3055bce

1 file changed

Lines changed: 3 additions & 41 deletions

File tree

Lib/test/test_free_threading/test_socket.py

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
@threading_helper.requires_working_threading()
1111
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.
1515

1616
def new_socket(self):
1717
s = socket.socket()
@@ -41,44 +41,6 @@ def test_getblocking_vs_settimeout(self):
4141
s = self.new_socket()
4242
self.check_race(s.getblocking, lambda: s.settimeout(0))
4343

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-
8244

8345
if __name__ == "__main__":
8446
unittest.main()

0 commit comments

Comments
 (0)