test(kubernetes): stop TEST 3 failing on the expected apiserver connect error#13701
Open
nic-6443 wants to merge 1 commit into
Open
test(kubernetes): stop TEST 3 failing on the expected apiserver connect error#13701nic-6443 wants to merge 1 commit into
nic-6443 wants to merge 1 commit into
Conversation
…ct error
TEST 3 is the only block in the file whose `service.host` is not the
apiserver the CI port-forwards to 127.0.0.1, so its informer can never
connect. The connect failure logs an `[error]`, and whether it lands inside
the block's window depends on how long resolving the host takes, so the
default `no_error_log: [error]` fails the block intermittently:
TEST 3: mixing set custom and default values - pattern "[error]" should
not match any line in error.log but matches line "... informer_factory.lua:302:
connect apiserver failed, apiserver.host: sample.com, apiserver.port: 6443,
message : connection refused, context: ngx.timer"
The block only compares the resolved configuration and never intends to
reach an apiserver, so the connect error is expected noise. Override
`no_error_log` for this block alone.
The neighbouring blocks are unaffected: they point at 127.0.0.1, which the
job actually serves. (Run the file without an apiserver on 127.0.0.1:6443
and the failure moves to them, with the same signature, while TEST 3 passes.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
t/kubernetes/discovery/kubernetes.tTEST 3 fails intermittently on master, for example in this run:TEST 3 is the only block in the file whose
service.hostis not the apiserver the job port-forwards to127.0.0.1, so its informer can never connect. Configuringdiscovery.kubernetesstarts the informer regardless, it fails to connect in anngx.timer, and it logs an[error]. The block sets neithererror_lognorno_error_log, sot/APISIX.pmgives it the defaultno_error_log: [error]and the block fails — but only when the connect fails early enough to land inside the block's own window. Since each block here has its ownyaml_config, nginx restarts between blocks and a slow-enough resolve means the timer is killed before it ever logs. That is what makes it intermittent rather than a hard failure.The block only compares the resolved configuration through
/compareand never intends to reach an apiserver, so the connect error is expected noise rather than a defect. This overridesno_error_logfor that block alone, using the same idiom already used elsewhere int/.The neighbouring blocks are deliberately left alone: they point at
127.0.0.1, which the job actually serves.How this was verified
Running the file locally with nothing listening on
127.0.0.1:6443inverts which host is reachable and reproduces the identical signature on the other blocks, while TEST 3 passes because the custom host happened to be connectable there:That confirms the mechanism: whichever block points at an apiserver the environment does not serve is the one the default
[error]check trips on, and in CI that block is TEST 3. With an[error]present in TEST 3's window, the block fails before this change and passes after it.Checklist