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: Update journal check in TestHistoryMetrics.testEvents to current systemd #20317

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

martinpitt
Copy link
Member

@martinpitt martinpitt commented Apr 15, 2024

journalctl recently updated its precise behavior wrt. matching
--since and --until against journal files, see [1]. This caused the
displayed log window for the "load" spike event to shift from the
earlier "Created slice cockpittest.slice" to the later
"load-hog.service" region, so that the old expected strings don't match
any more.

Update the expected strings for load-hog.service -- this actually makes
sense as this is the "load" spike event, so it feels like earlier
systemd versions got this wrong. Skip the test on more old OSes.
This will stop skipping this test as a naughty match for
cockpit-project/bots#5106 -- this is
established behaviour now.

Fixes #20302

[1] systemd/systemd#28746


Note that the changed test invalidates the naughty pattern, so we can remove it afterwards. There's also a second place for this, I'll address that next.

@martinpitt martinpitt marked this pull request as draft April 15, 2024 16:40
@martinpitt
Copy link
Member Author

This AppArmor failure was previously hidden by the naughty.

@martinpitt martinpitt added blocked Don't land until something else happens first (see task list) and removed blocked Don't land until something else happens first (see task list) labels Apr 16, 2024
@martinpitt martinpitt marked this pull request as ready for review April 16, 2024 07:48
@martinpitt martinpitt requested a review from jelly April 16, 2024 07:48

if self.machine.image == "centos-8-stream" or self.machine.image.startswith("rhel-8-"):
# Also, older systemds get a slightly wrong log window with --since/until
if re.search(r"centos-[89]|rhel-[89]|debian-stable|ubuntu-2204|ubuntu-stable", self.machine.image):
Copy link
Member

Choose a reason for hiding this comment

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

I almost wonder why we don't do version detection of systemd?

Copy link
Member Author

Choose a reason for hiding this comment

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

Two reasons from my POV: systemd has fractional versions and lots of distro patches, and I don't want to carry the old test variant around for a couple of years.

@@ -416,8 +416,8 @@ class TestHistoryMetrics(testlib.MachineCase):
# Now add the journal
# Journal was recorded on Fedora 33 and when trying to use it with older systemd it fails with:
# `Journal file /var/log/journal/*/journal.journal uses an unsupported feature, ignoring file.`
Copy link
Member

Choose a reason for hiding this comment

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

This comment is still relevant but also not relevant anymore as we now skip for a different reason?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, I updated the comment. While I was at it, I also dropped the RHEL 8 bits, as we don't test that any more.

…t systemd

`journalctl` recently updated its precise behavior wrt. matching
`--since` and `--until` against journal files, see [1]. This caused the
displayed log window for the "load" spike event to shift from the
earlier "Created slice cockpittest.slice" to the later
"load-hog.service" region, so that the old expected strings don't match
any more.

Update the expected strings for load-hog.service -- this actually makes
sense as this is the "load" spike event, so it feels like earlier
systemd versions got this wrong. Skip the test on more old OSes.
This will stop skipping this test as a naughty match for
cockpit-project/bots#5106 -- this is
established behaviour now.

Fixes cockpit-project#20302

[1] systemd/systemd#28746
@martinpitt martinpitt requested a review from jelly April 16, 2024 08:10
@jelly jelly merged commit f1218af into cockpit-project:main Apr 16, 2024
74 checks passed
@martinpitt martinpitt deleted the test-events-flake branch April 16, 2024 12:07
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.

TestHistoryMetrics.testEvents is flaky
2 participants