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

Ignore network unreachable error in hostname test #3074

Merged
merged 3 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ jobs:
# so we suppress "bad-option-value".
# * 3.9 will produce "no-member" for several properties/methods that are added to the mocks used by the unit tests (e.g
# "E1101: Instance of 'WireProtocol' has no 'aggregate_status' member") so we suppress that warning.
# * On 3.9 pylint crashes when parsing azurelinuxagent/daemon/main.py (see https://github.com/pylint-dev/pylint/issues/9473), so we ignore it.
# * 'no-self-use' ("R0201: Method could be a function") was moved to an optional extension on 3.8 and is no longer used by default. It needs
# to be suppressed for previous versions (3.0-3.7), though.
#
Expand All @@ -144,7 +145,7 @@ jobs:
PYLINT_OPTIONS="$PYLINT_OPTIONS --disable=bad-option-value"
fi
if [[ "${{ matrix.python-version }}" == "3.9" ]]; then
PYLINT_OPTIONS="$PYLINT_OPTIONS --disable=no-member"
PYLINT_OPTIONS="$PYLINT_OPTIONS --disable=no-member --ignore=main.py"
fi
if [[ "${{ matrix.python-version }}" =~ ^3\.[0-7]$ ]]; then
PYLINT_OPTIONS="$PYLINT_OPTIONS --disable=no-self-use"
Expand Down
6 changes: 3 additions & 3 deletions tests/ga/test_cgroupconfigurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,11 +644,11 @@ def mock_popen(command, *args, **kwargs):

# Popen can accept both strings and lists, handle both here.
if isinstance(command, str):
systemd_command = command.replace('systemd-run', 'systemd-run syntax_error')
command = command.replace('systemd-run', 'systemd-run syntax_error')
elif isinstance(command, list) and command[0] == 'systemd-run':
systemd_command = ['systemd-run', 'syntax_error'] + command[1:]
command = ['systemd-run', 'syntax_error'] + command[1:]

return original_popen(systemd_command, *args, **kwargs)
Copy link
Member Author

Choose a reason for hiding this comment

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

if neither of the 2 conditions above are true, systemd_command is undefined

return original_popen(command, *args, **kwargs)

expected_output = "[stdout]\n{0}\n\n\n[stderr]\n"

Expand Down
4 changes: 3 additions & 1 deletion tests_e2e/tests/publish_hostname/publish_hostname.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,13 @@ def get_ignore_error_rules(self) -> List[Dict[str, Any]]:
ignore_rules = [
#
# We may see temporary network unreachable warnings since we are bringing the network interface down
#
# 2024-02-16T09:27:14.114569Z WARNING MonitorHandler ExtHandler Error in SendHostPluginHeartbeat: [HttpError] [HTTP Failed] GET http://168.63.129.16:32526/health -- IOError [Errno 101] Network is unreachable -- 1 attempts made --- [NOTE: Will not log the same error for the next hour]
# 2024-02-28T05:37:55.562065Z ERROR ExtHandler ExtHandler Error fetching the goal state: [ProtocolError] GET vmSettings [correlation ID: 28de1093-ecb5-4515-ba8e-2ed0c7778e34 eTag: 4648629460326038775]: Request failed: [Errno 101] Network is unreachable
# 2024-02-29T09:30:40.702293Z ERROR ExtHandler ExtHandler Error fetching the goal state: [ProtocolError] [Wireserver Exception] [HttpError] [HTTP Failed] GET http://168.63.129.16/machine/ -- IOError [Errno 101] Network is unreachable -- 6 attempts made
#
{
'message': r"GET (http://168.63.129.16:32526/health|vmSettings).*\[Errno 101\] Network is unreachable",
'message': r"GET (http://168.63.129.16:32526/health|vmSettings|http://168.63.129.16/machine).*\[Errno 101\] Network is unreachable",
}
]
return ignore_rules
Expand Down
Loading