Message318411
Many Python unit tests require a blocking send into a pipe or a socket.
support.PIPE_MAX_SIZE (4 MiB +1 B) has been added for pipes in bpo-17835: sending PIPE_MAX_SIZE into a pipe must block.
On Linux, the maximum size of a pipe is /proc/sys/fs/pipe-max-size. Since Linux 2.6.35, it's now possible to get and set the size of a pipe using fcntl with F_GETPIPE_SZ and F_SETPIPE_SZ commands.
For sockets, support.SOCK_MAX_SIZE (16 MiB) has been added in bpo-18643. It's possible to get/set the size of receive and send socket buffers using getsockopt() and setsockopt() with SO_RCVBUF and SO_SNDBUF commands.
For pipes, I'm not sure that it's possible to get the size of a pipe buffer in a portable way. For example, F_GETPIPE_SZ was only introduced in Linux 2.6.35.
Since the first user of these features are tests, maybe we can start with best-effort functions in test.support.
Recently, I got issues with buffer sizes in test_multiprocessing_forkserver.test_ignore() (bpo-33532) and sendfile tests of test_asyncio (bpo-33353). |
|
Date |
User |
Action |
Args |
2018-06-01 13:18:19 | vstinner | set | recipients:
+ vstinner, pitrou, yselivanov |
2018-06-01 13:18:19 | vstinner | set | messageid: <1527859099.35.0.682650639539.issue33733@psf.upfronthosting.co.za> |
2018-06-01 13:18:19 | vstinner | link | issue33733 messages |
2018-06-01 13:18:19 | vstinner | create | |
|