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

bpo-35505: Skip test_imap4_host_default_value if localhost listens on IMAP port #11823

Merged
merged 4 commits into from
Feb 12, 2019
Merged

bpo-35505: Skip test_imap4_host_default_value if localhost listens on IMAP port #11823

merged 4 commits into from
Feb 12, 2019

Conversation

mcepl
Copy link
Contributor

@mcepl mcepl commented Feb 12, 2019

test_imaplib.TestImaplib.test_imap4_host_default_value fails when run on
the computer with the local IMAP server running. This may happen for
developers, who consequently don't need to be bothered about this test
failing.

https://bugs.python.org/issue35505

… IMAP port.

test_imaplib.TestImaplib.test_imap4_host_default_value fails when run on
the computer with the local IMAP server running. This may happen for
developers, who consequently don't need to be bothered about this test
failing.
@mcepl mcepl requested a review from a team as a code owner February 12, 2019 00:35
@bedevere-bot bedevere-bot added tests Tests in the Lib/test dir awaiting review labels Feb 12, 2019
Copy link
Contributor

@eamanu eamanu left a comment

Choose a reason for hiding this comment

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

lgtm. I don't think that is necessary a news for a new test.

@vstinner
Copy link
Member

Would it be possible to use a different port instead? Using test.support.find_unused_port() for example.

@vstinner
Copy link
Member

I tested manually.

Terminal 1:

echo -n|sudo nc -l 143 -v

Terminal 2:

./python -m test -u all test_imaplib -m test_imap4_host_default_value -v

Without this change, Terminal 1 shows an incoming connection ("Ncat: Connection from ::1:35778.") and the test fails with imaplib.IMAP4.abort: socket error: EOF.

With the change: no incoming connection and the test pass as expected.

Also, move NEWS item to right directory.
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

@miss-islington
Copy link
Contributor

Thanks @mcepl for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-11829 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 12, 2019
… IMAP port (pythonGH-11823)

Make test_imap4_host_default_value independent on whether the
local IMAP server is running.
(cherry picked from commit 3dc67d0)

Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
@vstinner
Copy link
Member

@mcepl: The patch doesn't apply cleanup on the 2.7 branch. Can you try to write at patch for 2.7?

@mcepl mcepl deleted the 35505_skip_on_listening_imap_port branch February 12, 2019 18:51
@mcepl
Copy link
Contributor Author

mcepl commented Feb 12, 2019

@vstinner There is nothing to port to … 2.7 just doesn't have this test case at all.

miss-islington added a commit that referenced this pull request Feb 12, 2019
… IMAP port (GH-11823)

Make test_imap4_host_default_value independent on whether the
local IMAP server is running.
(cherry picked from commit 3dc67d0)

Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
@vstinner
Copy link
Member

@vstinner There is nothing to port to … 2.7 just doesn't have this test case at all.

Aha :-D Good. I close the issue in that case ;-)

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants