Skip to content

test_smtplib.py no longer butt slow #46675

Closed

Description

@jerryseutter
BPO 2423
Nosy @devdanzin
Files
  • test_smtplib_speedup.patch: Changes to test_smtplib.py, rev 0
  • mock_socket.py: mock socket library that patch depends on
  • 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 = None
    closed_at = <Date 2010-08-03.06:39:59.042>
    created_at = <Date 2008-03-19.14:50:48.432>
    labels = ['tests', 'performance']
    title = 'test_smtplib.py no longer butt slow'
    updated_at = <Date 2010-08-03.06:39:59.041>
    user = 'https://bugs.python.org/jerryseutter'

    bugs.python.org fields:

    activity = <Date 2010-08-03.06:39:59.041>
    actor = 'richard'
    assignee = 'richard'
    closed = True
    closed_date = <Date 2010-08-03.06:39:59.042>
    closer = 'richard'
    components = ['Tests']
    creation = <Date 2008-03-19.14:50:48.432>
    creator = 'jerry.seutter'
    dependencies = []
    files = ['9766', '9767']
    hgrepos = []
    issue_num = 2423
    keywords = ['patch']
    message_count = 4.0
    messages = ['64058', '87913', '112424', '112556']
    nosy_count = 3.0
    nosy_names = ['richard', 'jerry.seutter', 'ajaksu2']
    pr_nums = []
    priority = 'low'
    resolution = 'accepted'
    stage = 'commit review'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue2423'
    versions = ['Python 3.2']

    Activity

    1. jerryseutter commented on Mar 19, 2008

      jerryseuttermannequin
      MannequinAuthor

      Changes only affect test files.

      test_smtplib.py before: 39.7s
      test_smtplib.py after: 0.8s

      socket.getfqdn() calls were causing all the slowness. Added a
      mock_socket.py file to handle some tests. For other tests that tested
      both server side and client side of the smtp libraries, mocked out
      socket.getfqdn() only.

    2. devdanzin commented on May 16, 2009

      devdanzinmannequin
      Mannequin

      What platform is that? I'm sure I don't get such a long runtime for
      test_smtplib on Linux. Maybe this was fixed by changes in socket or
      smtplib itself?

    3. richard commented on Aug 2, 2010

      richardmannequin
      Mannequin

      The patch to test_smtplib.py no longer applies since trunk is now py3k. I'm looking into it - and seeing whether the mock socket work I implemented for test_smtpd.py will have any common code. I'm hitting some "fun" areas of py3k-ness with bytes/str stuff in smtplib at the moment though ;-)

    4. self-assigned this
      on Aug 2, 2010
    5. richard commented on Aug 3, 2010

      richardmannequin
      Mannequin

      Merged mock socket from test_smtpd.py and committed.

    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      performancePerformance or resource usagetestsTests in the Lib/test dir

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions