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

Fix #4556

Merged
merged 1 commit into from
Oct 26, 2023
Merged

Fix #4556

merged 1 commit into from
Oct 26, 2023

Conversation

a-dubs
Copy link
Collaborator

@a-dubs a-dubs commented Oct 25, 2023

Proposed Commit Message

fix: added mock to stop leaking journalctl that slows down unit test

In test_logs.py, test_collect_logs_includes_optional_userdata() would leak the
journalctl subprocess call because it did not mock subprocess.call() like
test_collect_logs_creates_tarfile() does. This would cause the unit test to
take a long time to run because it was calling the actual journalctl command.

Fixes GH-4536 (GitHub Issue number. Remove line if irrelevant)

Additional Context

Test Steps

Checklist

@holmanb
Copy link
Member

holmanb commented Oct 25, 2023

@a-dubs I see this is still in draft state, though I just tested it and it fixes the bug. Do you have more changes to make here, or are you ready for this to merge?

Copy link
Member

@holmanb holmanb left a comment

Choose a reason for hiding this comment

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

Fixes the bug for me. Thanks @a-dubs!

@holmanb holmanb marked this pull request as ready for review October 26, 2023 15:29
@holmanb holmanb merged commit 5012d77 into canonical:main Oct 26, 2023
holmanb pushed a commit to holmanb/cloud-init that referenced this pull request Oct 31, 2023
…anonical#4556)

In test_logs.py, test_collect_logs_includes_optional_userdata() would leak the
journalctl subprocess call because it did not mock subprocess.call() like
test_collect_logs_creates_tarfile() does. This would cause the unit test to
take a long time to run because it was calling the actual journalctl command.

Fixes canonicalGH-4536
blackboxsw pushed a commit that referenced this pull request Nov 2, 2023
…4556)

In test_logs.py, test_collect_logs_includes_optional_userdata() would leak the
journalctl subprocess call because it did not mock subprocess.call() like
test_collect_logs_creates_tarfile() does. This would cause the unit test to
take a long time to run because it was calling the actual journalctl command.

Fixes GH-4536
blackboxsw pushed a commit to blackboxsw/cloud-init that referenced this pull request Nov 6, 2023
…anonical#4556)

In test_logs.py, test_collect_logs_includes_optional_userdata() would leak the
journalctl subprocess call because it did not mock subprocess.call() like
test_collect_logs_creates_tarfile() does. This would cause the unit test to
take a long time to run because it was calling the actual journalctl command.

Fixes canonicalGH-4536
holmanb pushed a commit that referenced this pull request Nov 14, 2023
…4556)

In test_logs.py, test_collect_logs_includes_optional_userdata() would leak the
journalctl subprocess call because it did not mock subprocess.call() like
test_collect_logs_creates_tarfile() does. This would cause the unit test to
take a long time to run because it was calling the actual journalctl command.

Fixes GH-4536
holmanb pushed a commit that referenced this pull request Nov 14, 2023
…4556)

In test_logs.py, test_collect_logs_includes_optional_userdata() would leak the
journalctl subprocess call because it did not mock subprocess.call() like
test_collect_logs_creates_tarfile() does. This would cause the unit test to
take a long time to run because it was calling the actual journalctl command.

Fixes GH-4536
holmanb pushed a commit that referenced this pull request Nov 14, 2023
…4556)

In test_logs.py, test_collect_logs_includes_optional_userdata() would leak the
journalctl subprocess call because it did not mock subprocess.call() like
test_collect_logs_creates_tarfile() does. This would cause the unit test to
take a long time to run because it was calling the actual journalctl command.

Fixes GH-4536
holmanb pushed a commit that referenced this pull request Nov 14, 2023
…4556)

In test_logs.py, test_collect_logs_includes_optional_userdata() would leak the
journalctl subprocess call because it did not mock subprocess.call() like
test_collect_logs_creates_tarfile() does. This would cause the unit test to
take a long time to run because it was calling the actual journalctl command.

Fixes GH-4536
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants