Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-117657: fix race:sock_recv_impl suppressions for free-thread building #123697

Merged
merged 6 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions Lib/test/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -4806,23 +4806,27 @@ def testInterruptedSendmsgTimeout(self):


class TCPCloserTest(ThreadedTCPSocketTest):

def testClose(self):
conn, addr = self.serv.accept()
conn.close()

sd = self.cli
read, write, err = select.select([sd], [], [], 1.0)
self.assertEqual(read, [sd])
self.assertEqual(sd.recv(1), b'')
read, write, err = select.select([conn], [], [], 1.0)
self.assertEqual(read, [conn])
self.assertEqual(conn.recv(1), b'x')

conn.close()

# Calling close() many times should be safe.
conn.close()
conn.close()

def _testClose(self):
self.cli.connect((HOST, self.port))
self.cli.send(b'x')
time.sleep(1.0)
read, write, _ = select.select([self.cli], [], [], 0.1)
self.assertEqual(read, [self.cli])
self.assertEqual(self.cli.recv(1), b'')


class BasicSocketPairTest(SocketPairTest):
Expand Down
2 changes: 0 additions & 2 deletions Tools/tsan/suppressions_free_threading.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ race:set_allocator_unlocked
# These entries are for warnings that trigger in a library function, as called
# by a CPython function.

# https://gist.github.com/swtaarrs/8e0e365e1d9cecece3269a2fb2f2b8b8
race:sock_recv_impl
# https://gist.github.com/swtaarrs/08dfe7883b4c975c31ecb39388987a67
race:free_threadstate

Expand Down
Loading