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

test_gdb is susceptible to tty width settings #52563

Closed
davidmalcolm opened this issue Apr 5, 2010 · 2 comments
Closed

test_gdb is susceptible to tty width settings #52563

davidmalcolm opened this issue Apr 5, 2010 · 2 comments
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@davidmalcolm
Copy link
Member

BPO 8316
Nosy @bitdancer, @davidmalcolm
Files
  • fix-test_gdb-whitespace-issues.txt
  • 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/bitdancer'
    closed_at = <Date 2010-04-05.16:32:13.961>
    created_at = <Date 2010-04-05.16:10:32.652>
    labels = ['type-bug', 'tests']
    title = 'test_gdb is susceptible to tty width settings'
    updated_at = <Date 2010-04-05.16:32:13.958>
    user = 'https://github.com/davidmalcolm'

    bugs.python.org fields:

    activity = <Date 2010-04-05.16:32:13.958>
    actor = 'r.david.murray'
    assignee = 'r.david.murray'
    closed = True
    closed_date = <Date 2010-04-05.16:32:13.961>
    closer = 'r.david.murray'
    components = ['Tests']
    creation = <Date 2010-04-05.16:10:32.652>
    creator = 'dmalcolm'
    dependencies = []
    files = ['16766']
    hgrepos = []
    issue_num = 8316
    keywords = ['buildbot']
    message_count = 2.0
    messages = ['102383', '102384']
    nosy_count = 2.0
    nosy_names = ['r.david.murray', 'dmalcolm']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue8316'
    versions = ['Python 2.7']

    @davidmalcolm
    Copy link
    Member Author

    test_gdb's get_gdb_repr carves up a gdb backtrace to try to extract how gdb representated the data.

    When connected to a tty, gdb will insert additional newlines and spaces based on the width of the tty (internally it has a wrap_here() function to do this), so the test turned out to be somewhat susceptible to whitespace and tty configuration.

    I'm attaching a patch against trunk which I believe fixes this. I've tested it with various tty widths (from 5 columns wide through to 235 columns wide), and redirecting to a file, and all tests pass.

    [Seen on buildbot on this run:
    http://www.python.org/dev/buildbot/builders/sparc%20Ubuntu%20trunk/builds/37/steps/test/logs/stdio
    and I believe this was the cause of all of four of the five failures there.

    The remaining one "test_corrupt_tp_name" seems to be a different issue]

    @bitdancer
    Copy link
    Member

    Committed in r79803. I changed the assert_ to an if not m/fail, since assert_ is deprecated and I think the if makes it clearer than the assert_ what it is that is being checked.

    @bitdancer bitdancer added the tests Tests in the Lib/test dir label Apr 5, 2010
    @bitdancer bitdancer added the type-bug An unexpected behavior, bug, or error label Apr 5, 2010
    @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