FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-117657: fix race:sock_recv_impl suppressions for free-thread building by Zheaoli · Pull Request #123697 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) .txt  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
17 changes: 9 additions & 8 deletions Lib/test/test_socket.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4806,23 +4806,24 @@ def testInterruptedSendmsgTimeout(self):


class TCPCloserTest(ThreadedTCPSocketTest):

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

sd = self.cli
read, write, err = select.select([sd], [], [], 1.0)
self.assertEqual(read, [sd])
self.assertEqual(sd.recv(1), b'')
read, _, _ = select.select([conn], [], [], support.SHORT_TIMEOUT)
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))
time.sleep(1.0)
self.cli.send(b'x')
read, _, _ = select.select([self.cli], [], [], support.SHORT_TIMEOUT)
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL