Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-133089: Use original timeout value for TimeoutExpired when the func subprocess.run is called with a timeout #133103

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

Merged
merged 17 commits into from
May 5, 2025

Conversation

Zheaoli
Copy link
Contributor

@Zheaoli Zheaoli commented Apr 28, 2025

Zheaoli added 2 commits April 29, 2025 02:22
…ut=None' when the timeout is zero

Signed-off-by: Manjusaka <[email protected]>
Signed-off-by: Manjusaka <[email protected]>
Signed-off-by: Manjusaka <[email protected]>
Copy link
Contributor

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about a negative timeout? Why does wait need this too?

This needs doc updates, and a test.

@Zheaoli
Copy link
Contributor Author

Zheaoli commented Apr 28, 2025

What about a negative timeout?

How about raise ValueError when timeout is <=0

@StanFromIreland
Copy link
Contributor

StanFromIreland commented Apr 28, 2025

Hmm, looking at bash functions I get conflicting results. timeout throws an error for negative values and has no limit on 0, whereas other functions (e.g. read -t 0) actually use the limit (they stop instantly).

Yes, a value error is the way to go for negative timeouts.

Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think timeout=0 should be treated the same as timeout=None. This isn't done anywhere else in the standard library. For example, using asyncio as precedent:

import asyncio

async def main():
    async with asyncio.timeout(None):
        await asyncio.sleep(0)
        print("No timeout!")

    async with asyncio.timeout(0):
        await asyncio.sleep(0)  # TimeoutError

asyncio.run(main())

I think it would be better to fix the negative time.

@Zheaoli
Copy link
Contributor Author

Zheaoli commented May 1, 2025

I don't think timeout=0 should be treated the same as timeout=None. This isn't done anywhere else in the standard library. For example, using asyncio as precedent:

Make sense, I'll find a way to patch it

Zheaoli added 4 commits May 3, 2025 12:50
Signed-off-by: Manjusaka <[email protected]>
Signed-off-by: Manjusaka <[email protected]>
Signed-off-by: Manjusaka <[email protected]>
Signed-off-by: Manjusaka <[email protected]>
Copy link
Member

@gpshead gpshead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your documentation addition is useful, but the logic change is not what we want.

If you want a cleaner value in the TimeoutExpired error message in this situation, that could be done by catching and replacing the info in the TimeoutExpired exception from Popen._communicate's self.wait(timeout=self._remaining_time(endtime)) with the orig_timeout value that is known at that point. .wait() itself cannot meaningfully know that value.

@bedevere-app
Copy link

bedevere-app bot commented May 3, 2025

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Zheaoli added 2 commits May 3, 2025 22:02
Signed-off-by: Manjusaka <[email protected]>
Signed-off-by: Manjusaka <[email protected]>
@Zheaoli Zheaoli changed the title gh-133089: Make subprocess.run's behavior is same with 'timeout=None' when the timeout is zero gh-133089: Use origional timeout value for TimeoutExpired when the func subprocess.run is called with a timeout May 4, 2025
Signed-off-by: Manjusaka <[email protected]>
Zheaoli added 3 commits May 4, 2025 20:30
Signed-off-by: Manjusaka <[email protected]>
Signed-off-by: Manjusaka <[email protected]>
Signed-off-by: Manjusaka <[email protected]>
@gpshead gpshead added the needs backport to 3.13 bugs and security fixes label May 5, 2025
@gpshead gpshead changed the title gh-133089: Use origional timeout value for TimeoutExpired when the func subprocess.run is called with a timeout gh-133089: Use original timeout value for TimeoutExpired when the func subprocess.run is called with a timeout May 5, 2025
@gpshead gpshead enabled auto-merge (squash) May 5, 2025 01:04
@gpshead gpshead merged commit 2bbcaed into python:main May 5, 2025
45 checks passed
@miss-islington-app
Copy link

Thanks @Zheaoli for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 5, 2025
… the func `subprocess.run` is called with a timeout (pythonGH-133103)

(cherry picked from commit 2bbcaed)

Co-authored-by: Nadeshiko Manju <[email protected]>
Signed-off-by: Manjusaka <[email protected]>
Co-authored-by: Gregory P. Smith <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented May 5, 2025

GH-133418 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 5, 2025
gpshead added a commit that referenced this pull request May 5, 2025
…n the func `subprocess.run` is called with a timeout (GH-133103) (#133418)

gh-133089: Use original timeout value for `TimeoutExpired` when the func `subprocess.run` is called with a timeout (GH-133103)
(cherry picked from commit 2bbcaed)

Signed-off-by: Manjusaka <[email protected]>
Co-authored-by: Nadeshiko Manju <[email protected]>
Co-authored-by: Gregory P. Smith <[email protected]>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x RHEL8 LTO + PGO 3.x (tier-3) has failed when building commit 2bbcaed.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/442/builds/9283) and take a look at the build logs.
  4. Check if the failure is related to this commit (2bbcaed) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/442/builds/9283

Failed tests:

  • test_frame
  • test_subprocess

Failed subtests:

  • test_timeout_exception - test.test_subprocess.ProcessTestCaseNoPoll.test_timeout_exception

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-rhel8-s390x.lto-pgo/build/Lib/test/test_subprocess.py", line 171, in test_timeout_exception
    self.fail("Expected TimeoutExpired exception not raised")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected TimeoutExpired exception not raised

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora Stable Clang Installed 3.x (tier-3) has failed when building commit 2bbcaed.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1645/builds/352) and take a look at the build logs.
  4. Check if the failure is related to this commit (2bbcaed) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1645/builds/352

Failed tests:

  • test_subprocess

Failed subtests:

  • test_timeout_exception - test.test_subprocess.ProcessTestCaseNoPoll.test_timeout_exception
  • test_timeout_exception - test.test_subprocess.ProcessTestCase.test_timeout_exception

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.clang-installed/build/target/lib/python3.14/test/test_subprocess.py", line 177, in test_timeout_exception
    self.fail("Expected TimeoutExpired exception not raised")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected TimeoutExpired exception not raised


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.clang-installed/build/target/lib/python3.14/test/test_subprocess.py", line 171, in test_timeout_exception
    self.fail("Expected TimeoutExpired exception not raised")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected TimeoutExpired exception not raised

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora Stable LTO + PGO 3.x (tier-3) has failed when building commit 2bbcaed.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1627/builds/352) and take a look at the build logs.
  4. Check if the failure is related to this commit (2bbcaed) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1627/builds/352

Failed tests:

  • test_subprocess

Failed subtests:

  • test_timeout_exception - test.test_subprocess.ProcessTestCaseNoPoll.test_timeout_exception
  • test_timeout_exception - test.test_subprocess.ProcessTestCase.test_timeout_exception

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.lto-pgo/build/Lib/test/test_subprocess.py", line 171, in test_timeout_exception
    self.fail("Expected TimeoutExpired exception not raised")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected TimeoutExpired exception not raised

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Windows Server 2022 NoGIL 3.13 (tier-1) has failed when building commit 3d1b8e2.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1488/builds/1266) and take a look at the build logs.
  4. Check if the failure is related to this commit (3d1b8e2) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1488/builds/1266

Failed tests:

  • test_subprocess

Failed subtests:

  • test_timeout_exception - test.test_subprocess.ProcessTestCase.test_timeout_exception

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "C:\Users\Administrator\buildarea\3.13.itamaro-win64-srv-22-aws.x64.nogil\build\Lib\test\test_subprocess.py", line 166, in test_timeout_exception
    subprocess.run(['echo', 'hi'], timeout = -1)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\buildarea\3.13.itamaro-win64-srv-22-aws.x64.nogil\build\Lib\subprocess.py", line 554, in run
    with Popen(*popenargs, **kwargs) as process:
         ~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\buildarea\3.13.itamaro-win64-srv-22-aws.x64.nogil\build\Lib\subprocess.py", line 1039, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        pass_fds, cwd, env,
                        ^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
                        gid, gids, uid, umask,
                        ^^^^^^^^^^^^^^^^^^^^^^
                        start_new_session, process_group)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\buildarea\3.13.itamaro-win64-srv-22-aws.x64.nogil\build\Lib\subprocess.py", line 1554, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
                             # no special security
                             ^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
                             cwd,
                             ^^^^
                             startupinfo)
                             ^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora Stable 3.13 (tier-3) has failed when building commit 3d1b8e2.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1658/builds/128) and take a look at the build logs.
  4. Check if the failure is related to this commit (3d1b8e2) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1658/builds/128

Failed tests:

  • test_os
  • test_subprocess

Failed subtests:

  • test_timerfd_select - test.test_os.TimerfdTests.test_timerfd_select
  • test_timeout_exception - test.test_subprocess.ProcessTestCase.test_timeout_exception
  • test_timeout_exception - test.test_subprocess.ProcessTestCaseNoPoll.test_timeout_exception

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-fedora-stable-s390x/build/Lib/test/test_os.py", line 4288, in test_timerfd_select
    self.assertEqual(self.read_count_signaled(fd), 1)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 2 != 1


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-fedora-stable-s390x/build/Lib/test/test_subprocess.py", line 170, in test_timeout_exception
    self.fail("Expected TimeoutExpired exception not raised")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected TimeoutExpired exception not raised

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x RHEL9 LTO 3.13 (tier-3) has failed when building commit 3d1b8e2.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1577/builds/702) and take a look at the build logs.
  4. Check if the failure is related to this commit (3d1b8e2) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1577/builds/702

Failed tests:

  • test_subprocess

Failed subtests:

  • test_timeout_exception - test.test_subprocess.ProcessTestCase.test_timeout_exception

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-rhel9-s390x.lto/build/Lib/test/test_subprocess.py", line 170, in test_timeout_exception
    self.fail("Expected TimeoutExpired exception not raised")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected TimeoutExpired exception not raised

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora Stable Clang 3.13 (tier-3) has failed when building commit 3d1b8e2.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1667/builds/128) and take a look at the build logs.
  4. Check if the failure is related to this commit (3d1b8e2) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1667/builds/128

Failed tests:

  • test_subprocess

Failed subtests:

  • test_timeout_exception - test.test_subprocess.ProcessTestCaseNoPoll.test_timeout_exception
  • test_timeout_exception - test.test_subprocess.ProcessTestCase.test_timeout_exception

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-fedora-stable-s390x.clang/build/Lib/test/test_subprocess.py", line 176, in test_timeout_exception
    self.fail("Expected TimeoutExpired exception not raised")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected TimeoutExpired exception not raised


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-fedora-stable-s390x.clang/build/Lib/test/test_subprocess.py", line 170, in test_timeout_exception
    self.fail("Expected TimeoutExpired exception not raised")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected TimeoutExpired exception not raised

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Ubuntu Shared 3.x (tier-1) has failed when building commit 2bbcaed.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/506/builds/10590) and take a look at the build logs.
  4. Check if the failure is related to this commit (2bbcaed) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/506/builds/10590

Failed tests:

  • test_subprocess

Failed subtests:

  • test_timeout_exception - test.test_subprocess.ProcessTestCaseNoPoll.test_timeout_exception
  • test_remote_stack_trace - test.test_external_inspection.TestGetStackTrace.test_remote_stack_trace
  • test_timeout_exception - test.test_subprocess.ProcessTestCase.test_timeout_exception

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_subprocess.py", line 171, in test_timeout_exception
    self.fail("Expected TimeoutExpired exception not raised")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected TimeoutExpired exception not raised


Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_external_inspection.py", line 104, in test_remote_stack_trace
    self.assertEqual(stack_trace, expected_stack_trace)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Lists differ: [('fo[62 chars]y', 14), ('baz', '/tmp/test_python_m2xu4jch/tm[186 chars] 17)] != [('fo[62 chars]y', 15), ('baz', '/tmp/test_python_m2xu4jch/tm[186 chars] 17)]


Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_subprocess.py", line 177, in test_timeout_exception
    self.fail("Expected TimeoutExpired exception not raised")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected TimeoutExpired exception not raised

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora Stable Refleaks 3.13 (tier-3) has failed when building commit 3d1b8e2.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1662/builds/133) and take a look at the build logs.
  4. Check if the failure is related to this commit (3d1b8e2) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1662/builds/133

Failed tests:

  • test_subprocess
  • test_socket

Failed subtests:

  • testSourceAddress - test.test_socket.NetworkConnectionAttributesTest.testSourceAddress
  • test_timeout_exception - test.test_subprocess.ProcessTestCase.test_timeout_exception

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-fedora-stable-s390x.refleak/build/Lib/test/test_subprocess.py", line 170, in test_timeout_exception
    self.fail("Expected TimeoutExpired exception not raised")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected TimeoutExpired exception not raised


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-fedora-stable-s390x.refleak/build/Lib/test/test_socket.py", line 417, in raise_queued_exception
    raise self.queue.get()
  File "/home/buildbot/buildarea/3.13.cstratak-fedora-stable-s390x.refleak/build/Lib/test/test_socket.py", line 454, in clientRun
    test_func()
    ~~~~~~~~~^^
  File "/home/buildbot/buildarea/3.13.cstratak-fedora-stable-s390x.refleak/build/Lib/test/test_socket.py", line 5783, in _testSourceAddress
    self.assertEqual(self.cli.getsockname()[1], self.source_port)
                     ~~~~~~~~~~~~~~~~~~~~^^
OSError: [Errno 9] Bad file descriptor

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 FreeBSD Refleaks 3.13 (tier-3) has failed when building commit 3d1b8e2.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1615/builds/733) and take a look at the build logs.
  4. Check if the failure is related to this commit (3d1b8e2) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1615/builds/733

Failed tests:

  • test_subprocess

Failed subtests:

  • test_timeout_exception - test.test_subprocess.ProcessTestCaseNoPoll.test_timeout_exception
  • test_timeout_exception - test.test_subprocess.ProcessTestCase.test_timeout_exception

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/buildbot/buildarea/3.13.ware-freebsd.refleak/build/Lib/test/test_subprocess.py", line 176, in test_timeout_exception
    self.fail("Expected TimeoutExpired exception not raised")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected TimeoutExpired exception not raised

gpshead added a commit to gpshead/cpython that referenced this pull request May 5, 2025
The few buildbot failures on python#133103
are possibly just due to racing a child process launch and exit?
gpshead added a commit that referenced this pull request May 5, 2025
The few buildbot failures on #133103
are possibly just due to racing a child process launch and exit?
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 5, 2025
…GH-133420)

The few buildbot failures on python#133103
are possibly just due to racing a child process launch and exit?
(cherry picked from commit b64aa30)

Co-authored-by: Gregory P. Smith <[email protected]>
gpshead added a commit that referenced this pull request May 5, 2025
…H-133420) (#133421)

[tests] test_subprocess maybe avoid a timeout race condition? (GH-133420)

The few buildbot failures on #133103
are possibly just due to racing a child process launch and exit?
(cherry picked from commit b64aa30)

Co-authored-by: Gregory P. Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Negative run-time reported by subprocess.run's TimeoutExpired exception when setting timeout=0
5 participants