Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

test_ssl: non_linux_skip_if_other_okay_error assumes err.reason is a string #126499

Copy link
Copy link
Closed
@encukou

Description

@encukou
Issue body actions

Recently, test_ssl has been failing intermittently but frequently on macOS buildbots, see for example here.

Since #108315, there's some code to skip tests, which does getattr(err, "reason", "") on an arbitrary exception and expects that to be a string. If reason is set to None, a regex search on it fails. This prevents the calling test from checking that the error is correct.

Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_ssl.py", line 5085, in test_preauth_data_to_tls_server
    self.non_linux_skip_if_other_okay_error(wrap_error)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_ssl.py", line 5032, in non_linux_skip_if_other_okay_error
    re.search('wrong.version.number', getattr(err, "reason", ""), re.I)):
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/re/__init__.py", line 177, in search
    return _compile(pattern, flags).search(string)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
TypeError: expected string or bytes-like object, got 'NoneType'

I'll send a PR soon.

Linked PRs

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.