test(source): remove flaky log assertions from pod tests#5517
test(source): remove flaky log assertions from pod tests#5517k8s-ci-robot merged 2 commits intokubernetes-sigs:masterfrom
Conversation
|
Hi @u-kai. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
If you removing this capability from tests, we need a compensation. Testing similar capabilities but without paralel execution |
|
@ivankatliarchuk I personally don't think the log assertions in this test are essential, especially since it's just |
|
/hold |
|
compensation for removed testing capability is required. |
|
as well as static analysis for correct use of test.Parallel() is needed |
The only part that is no longer being tested after my change is the log output. |
|
Yes, there is no need to validate same logs for each test, so only few tests have logging valided. We could have separate test that just verify log messages. Agree that it does single log level testing, not efficient. |
|
@ivankatliarchuk |
| } | ||
|
|
||
| func TestPodSourceLogs(t *testing.T) { | ||
| t.Parallel() |
There was a problem hiding this comment.
do we need Parallel for that? Just a comment, not necessary need to action
There was a problem hiding this comment.
I think it's needed here, because as discussed below, using t.Parallel at this level is safe and allows us to parallelize the tests.
|
/unhold |
mloiseleur
left a comment
There was a problem hiding this comment.
See my suggestion: t.Parallel() should be inside the for loop.
apart from that, LGTM. Thanks for your help on this 👍
|
@mloiseleur This happens because the parallel tests share state and have conflicting expectations about whether certain log messages should or should not appear. For this reason, I personally prefer keeping the current approach without using |
Make sense to me. We want the CI to be as reliable as we can 👍 |
Got it, I'll leave it as is then. |
|
/approve |
|
/test pull-external-dns-unit-test |
|
/test all |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ivankatliarchuk, mloiseleur The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What does it do ?
Remove flaky log assertions from
TestPodSourceto fix race conditions that caused intermittent test failures with "Expected no debug messages" errors.Example of the race condition failure: : link
Motivation
The
TestPodSourcetest was experiencing flaky failures due to race conditions when running in parallel.The issue occurred because:
t.Parallel()were simultaneouslymodifying the global logrus logger through
LogsUnderTestWithLogLevel()focusing on the core functionality
Solution: Remove log testing entirely and focus on endpoint generation correctness, which is
the actual functionality being tested.
More