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_imaplib takes 40+ minutes in refleaks builds #120048

Closed
colesbury opened this issue Jun 4, 2024 · 0 comments
Closed

test_imaplib takes 40+ minutes in refleaks builds #120048

colesbury opened this issue Jun 4, 2024 · 0 comments
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@colesbury
Copy link
Contributor

colesbury commented Jun 4, 2024

Bug report

Similar to #120039, test_imaplib has at least one test that expects a timeout and that time out is scaled up with the global time out, so the refleaks tests unnecessarily take 40+ minutes.

class SimpleIMAPHandler(socketserver.StreamRequestHandler):
timeout = support.LOOPBACK_TIMEOUT

@requires_resource('walltime')
def test_imaplib_timeout_test(self):
_, server = self._setup(SimpleIMAPHandler)
addr = server.server_address[1]
client = self.imap_class("localhost", addr, timeout=None)
self.assertEqual(client.sock.timeout, None)
client.shutdown()
client = self.imap_class("localhost", addr, timeout=support.LOOPBACK_TIMEOUT)
self.assertEqual(client.sock.timeout, support.LOOPBACK_TIMEOUT)
client.shutdown()
with self.assertRaises(ValueError):
client = self.imap_class("localhost", addr, timeout=0)

Linked PRs

@colesbury colesbury added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir labels Jun 4, 2024
colesbury added a commit to colesbury/cpython that referenced this issue Jun 4, 2024
The `test_imaplib` was taking 40+ minutes in the refleak build bots
because we were using LOOPBACK_TIMEOUT for tests cases that expect to
timeout. LOOPBACK_TIMEOUT scales with the global timeout.

We should use a fixed, very small timeout for cases that we expect to
timeout.
colesbury added a commit that referenced this issue Jun 4, 2024
The `test_imaplib` was taking 40+ minutes in the refleak build bots because
the tests waiting on a client `self._setup()` was creating a client that
prevented progress until its connection timed out, which scaled with the
global timeout.

We should set `connect=False` for the tests that don't want `_setup()` to
create a client.

Co-authored-by: Serhiy Storchaka <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 4, 2024
The `test_imaplib` was taking 40+ minutes in the refleak build bots because
the tests waiting on a client `self._setup()` was creating a client that
prevented progress until its connection timed out, which scaled with the
global timeout.

We should set `connect=False` for the tests that don't want `_setup()` to
create a client.

(cherry picked from commit 710cbea)

Co-authored-by: Sam Gross <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 4, 2024
The `test_imaplib` was taking 40+ minutes in the refleak build bots because
the tests waiting on a client `self._setup()` was creating a client that
prevented progress until its connection timed out, which scaled with the
global timeout.

We should set `connect=False` for the tests that don't want `_setup()` to
create a client.

(cherry picked from commit 710cbea)

Co-authored-by: Sam Gross <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
colesbury added a commit that referenced this issue Jun 4, 2024
The `test_imaplib` was taking 40+ minutes in the refleak build bots because
the tests waiting on a client `self._setup()` was creating a client that
prevented progress until its connection timed out, which scaled with the
global timeout.

We should set `connect=False` for the tests that don't want `_setup()` to
create a client.

(cherry picked from commit 710cbea)

Co-authored-by: Sam Gross <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
colesbury added a commit that referenced this issue Jun 4, 2024
The `test_imaplib` was taking 40+ minutes in the refleak build bots because
the tests waiting on a client `self._setup()` was creating a client that
prevented progress until its connection timed out, which scaled with the
global timeout.

We should set `connect=False` for the tests that don't want `_setup()` to
create a client.

(cherry picked from commit 710cbea)

Co-authored-by: Sam Gross <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
barneygale pushed a commit to barneygale/cpython that referenced this issue Jun 5, 2024
The `test_imaplib` was taking 40+ minutes in the refleak build bots because
the tests waiting on a client `self._setup()` was creating a client that
prevented progress until its connection timed out, which scaled with the
global timeout.

We should set `connect=False` for the tests that don't want `_setup()` to
create a client.

Co-authored-by: Serhiy Storchaka <[email protected]>
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
The `test_imaplib` was taking 40+ minutes in the refleak build bots because
the tests waiting on a client `self._setup()` was creating a client that
prevented progress until its connection timed out, which scaled with the
global timeout.

We should set `connect=False` for the tests that don't want `_setup()` to
create a client.

Co-authored-by: Serhiy Storchaka <[email protected]>
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
The `test_imaplib` was taking 40+ minutes in the refleak build bots because
the tests waiting on a client `self._setup()` was creating a client that
prevented progress until its connection timed out, which scaled with the
global timeout.

We should set `connect=False` for the tests that don't want `_setup()` to
create a client.

Co-authored-by: Serhiy Storchaka <[email protected]>
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

1 participant