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

Sporadic failure in test_dump_tracebacks_later_file (test_faulthandler) #60175

Closed
ezio-melotti opened this issue Sep 19, 2012 · 3 comments
Closed
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@ezio-melotti
Copy link
Member

BPO 15971
Nosy @vstinner, @ezio-melotti, @ambv

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/vstinner'
closed_at = <Date 2014-03-25.11:36:55.640>
created_at = <Date 2012-09-19.03:47:45.352>
labels = ['type-bug', 'tests']
title = 'Sporadic failure in test_dump_tracebacks_later_file (test_faulthandler)'
updated_at = <Date 2014-03-25.11:36:55.639>
user = 'https://github.com/ezio-melotti'

bugs.python.org fields:

activity = <Date 2014-03-25.11:36:55.639>
actor = 'vstinner'
assignee = 'vstinner'
closed = True
closed_date = <Date 2014-03-25.11:36:55.640>
closer = 'vstinner'
components = ['Tests']
creation = <Date 2012-09-19.03:47:45.352>
creator = 'ezio.melotti'
dependencies = []
files = []
hgrepos = []
issue_num = 15971
keywords = []
message_count = 3.0
messages = ['170700', '170722', '214813']
nosy_count = 3.0
nosy_names = ['vstinner', 'ezio.melotti', 'lukasz.langa']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'needs patch'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue15971'
versions = ['Python 3.3']

@ezio-melotti
Copy link
Member Author

Seen on http://buildbot.python.org/all/builders/AMD64%20Lion%203.x/builds/428/steps/test/logs/stdio

======================================================================
FAIL: test_dump_tracebacks_later_file (test.test_faulthandler.FaultHandlerTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/ambv/Buildbot/3.x.langa-lion/build/Lib/test/test_faulthandler.py", line 490, in test_dump_tracebacks_later_file
    self.check_dump_tracebacks_later(file=True)
  File "/Users/ambv/Buildbot/3.x.langa-lion/build/Lib/test/test_faulthandler.py", line 476, in check_dump_tracebacks_later
    filename, loops)
  File "/Users/ambv/Buildbot/3.x.langa-lion/build/Lib/test/test_faulthandler.py", line 460, in _check_dump_tracebacks_later
    self.assertRegex(trace, regex)
AssertionError: Regex didn't match: '^Timeout \\(0:00:00.500000\\)!\\nThread 0x[0-9a-f]+:\\n  File "<string>", line 9 in func\n  File "<string>", line 20 in <module>$' not found in 'Timeout (0:00:00.500000)!\nThread 0x00007fff77d85960:\n  File "<string>", line 10 in func\n  File "<string>", line 20 in <module>'

Ran 30 tests in 126.504s

The regex expects the failure to be at "line 9 in func", but the failure happens at "line 10".

@ezio-melotti ezio-melotti added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Sep 19, 2012
@vstinner
Copy link
Member

Code of the failing test:
----

import faulthandler
import time

def func(timeout, repeat, cancel, file, loops):
    for loop in range(loops):
        faulthandler.dump_tracebacks_later(timeout, repeat=repeat, file=file)
        if cancel:
            faulthandler.cancel_dump_tracebacks_later()
        time.sleep(timeout * 5)  # line 9
        faulthandler.cancel_dump_tracebacks_later()   # line 10

timeout = {timeout}
repeat = {repeat}
cancel = {cancel}
loops = {loops}
if {has_filename}:
    file = open({filename}, "wb")
else:
    file = None
func(timeout, repeat, cancel, file, loops)
if file is not None:
    file.close()

If the test fails at line 10: it means that it failed to dump the
traceback in 2.5 seconds, whereas the traceback must be dumped after a
timeout of 0.5 second.

Do you know if the system load of this particular buildbot is high? It
would be nice to have the system load in the output of the buildbot.

We might change the timeout, but it is already long.

@vstinner
Copy link
Member

I didn't see this error recently.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants