-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
system test: skip some quadlet tests when use journald log driver #19236
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sstosh The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
In my environment, flakes similar to #18132 occur other than Error log
|
8e24fd8
to
bdbb928
Compare
test/system/252-quadlet.bats
Outdated
Notify=yes | ||
LogDriver=passthrough |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this makes sense. One test for passthrough is enough we should not duplicate the test for every single one.
Only using wait_for_output
should be enough to address flakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If LogDriver=passthrough
is removed , STARTED CONTAINER
will not be written to journald, and the test will fail.
(Is this a bug?)
Error log
#
# Jul 14 00:18:40 test systemd[1]: Starting basic_4SD5D8ioUH.service...
# Jul 14 00:18:40 test basic_4SD5D8ioUH[262279]: 910435b96ecd7dfb4900b86e4b9f0d19e9d0b9e93ba1c17653a688077f0d18d2
# Jul 14 00:18:40 test systemd[1]: Started basic_4SD5D8ioUH.service.
# # systemctl show --value --property=ActiveState basic_4SD5D8ioUH.service
# active
# [00:18:40.646492693] # podman logs systemd-basic_4SD5D8ioUH
# [00:18:40.683215557] STARTED CONTAINER
# [00:18:40.691517200] # podman logs systemd-basic_4SD5D8ioUH
# [00:18:40.723299024] STARTED CONTAINER
# #/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# #| FAIL: podman logs systemd-basic_4SD5D8ioUH
# #| expected: '.*STARTED CONTAINER.*' (using expr)
# #| actual: '-- Logs begin at Thu 2023-07-13 11:38:17 JST, end at Fri 2023-07-14 00:18:40 JST. --'
# #| > 'Jul 14 00:18:40 test systemd[1]: Starting basic_4SD5D8ioUH.service...'
# #| > 'Jul 14 00:18:40 test basic_4SD5D8ioUH[262279]: 910435b96ecd7dfb4900b86e4b9f0d19e9d0b9e93ba1c17653a688077f0d18d2'
# #| > 'Jul 14 00:18:40 test systemd[1]: Started basic_4SD5D8ioUH.service.'
# #\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do you run the tests? Is your default log driver not journald?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No time to review right now, but sleep inf
is evil: sleep is noninterruptible, so podman stop
takes an extra ten seconds. Did you confirm that this change does not affect test runtimes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do you run the tests? Is your default log driver not journald?
The default log driver is k8s-file
. (This is the initial value set in the containers.conf for RHEL8 series.)
When the log driver was changed to journald
from k8s-file
, the test was successful without setting LogDriver=paththrough
.
Considering this, it seems necessary to either change the log driver to journald
or skip it when it is set to k8s-file
.
@edsantiago PTAL. Not sure it's really needed because I think the root cause is in configuration of @sstosh's local environment. But, still worth checking |
Some quadlet tests can only be run when the log driver is set to journald in containers.conf. Therefore, those tests will be skipped if the log driver is not set to journald. Signed-off-by: Toshiki Sonoda <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under this PR, test runtime goes from 85s to 136s (root), 68s->105s (rootless). Please revert back to top
.
Also, rootless Not your fault. Filed #19267 to fix.volume path
test is consistently failing on my f38 laptop; also failing on main
so it doesn't look like your fault. Still investigating.
bdbb928
to
b872ef3
Compare
When podman uses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't help thinking that this is the wrong approach.
The proximate problem is, tests are looking for a string in the journal. Taking a step back, though, is this testing the journal or is it testing if a container has started? Can there be another way to verify that a container has started, like touching a file, or SDNOTIFY, or using podman logs
?
@sstosh that's a question for @containers/podman-maintainers, not for you, but I'm blocking right now because I think it's important to step back and understand this problem better. Also because there's a little too much duplication in your approach.
Thank you for identifying this problem and bringing it to our attention.
Followup: podman/test/system/252-quadlet.bats Line 19 in b88f9b3
Is this true? Is quadlet meaningless on |
Yes there seems no reason to check a sting in the journal.
Not really, the proper check would be systemd unavailable but I guess this would be the same as journald unavailable. |
@edsantiago You added this line here: cf5df5b where you actually say that it is an overkill. I'm guessing you added it because the tests rely on the journal, not because Quadlet does. Also, please keep in mind that Quadlet started off as an opinionated solution which forces I agree that it seems that in some of the case the journal is used to check that the container is running and not for anything else. For these cases, we surely need to find a better way |
Oops. Thank you for that. It was obviously one of my emergency las-minute RHEL fixes. I will make time today to find a better solution. |
Close this PR because #19276 was merged. |
Some quadlet tests can only be run when the log driver is set to journald in containers.conf.
Therefore, those tests will be skipped if the log driver is not set to journald.
Does this PR introduce a user-facing change?