Azure / Azure/WALinuxAgent

[BUG] Test failure: tests/common/test_event.py::TestEvent::test_collect_events_should_ignore_invalid_event_files - AssertionError: 3 != 2

Open
#3,217 0 comments 0 reactions 1 assignee Claimed by @narrieta View on GitHub
Dominant language
Python
Stars
581
Forks
397
Avg merge
2d 15h
Merged PRs (30d)
9

Description

**Describe the bug: A clear and concise description of what the bug is.**

```
@skip_if_predicate_true(is_python_version_26_or_34, "Disabled on Python 2.6 and 3.4, they run on containers where the OS commands needed by the test are not present.")
def test_collect_events_should_ignore_invalid_event_files(self):
self._create_test_event_file("custom_script_1.tld") # a valid event
self._create_test_event_file("custom_script_utf-16.tld")
self._create_test_event_file("custom_script_invalid_json.tld")
os.chmod(self._create_test_event_file("custom_script_no_read_access.tld"), 0o200)
self._create_test_event_file("custom_script_2.tld") # another valid event

with patch("azurelinuxagent.common.event.add_event") as mock_add_event:
event_list = self._collect_events()

> self.assertEqual(
len(event_list), 2)
E AssertionError: 3 != 2

tests/common/test_event.py:429: AssertionError
```

**Distro and WALinuxAgent details (please complete the following information):**
Debian 13

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.