Repository navigation
tests: attempt to deflake proxy tests - #7696
Merged
Merged
Conversation
I couldn't repro this locally but there were occasional CI flakes in the proxy test that pulls a git repo and verifies the proxy logs show a connection to github.com (needed to verify that git ops correctly use proxy settings). My best guess is that the squid logs were just not always flushed by the time they were read for the test assertion, so this updates the tests to explicitly start/stop the squid service and do some retries on reading the logs. Will have to see if this actually fixes the problem. If not there's more complicated options like starting a separate custom git service, intercepting traffic and asserting there. Would prefer to avoid complicating these already complicated tests further if possible though. Signed-off-by: Erik Sipsma <[email protected]>
sipsma
force-pushed
the
deflake-proxy-tests
branch
from
June 18, 2024 18:43
5554de7 to
80d265d
Compare
vito
reviewed
Jun 18, 2024
| test.proxyLogTest(t, c, func(ctx context.Context) (string, error) { | ||
| return c.Container().From(alpineImage). | ||
| WithMountedCache("/var/log/squidaccess", squidLogsVolume). | ||
| WithExec([]string{"cat", "/var/log/squidaccess/access.log"}). |
Contributor
There was a problem hiding this comment.
Does this need a cache-buster for the cat?
Contributor
Author
There was a problem hiding this comment.
Ah yeah good point! Wouldn't be surprised if that was part/whole of the flake before, I'll keep these updates but add that in too
Signed-off-by: Erik Sipsma <[email protected]>
vito
approved these changes
Jun 18, 2024
vito
left a comment
Contributor
There was a problem hiding this comment.
Nice - will keep an eye out to see if it comes up again!
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.
I couldn't repro this locally but there were occasional CI flakes in the proxy test that pulls a git repo and verifies the proxy logs show a connection to github.com (needed to verify that git ops correctly use proxy settings).
My best guess is that the squid logs were just not always flushed by the time they were read for the test assertion, so this updates the tests to explicitly start/stop the squid service and do some retries on reading the logs.
Will have to see if this actually fixes the problem. If not there's more complicated options like starting a separate custom git service, intercepting traffic and asserting there. Would prefer to avoid complicating these already complicated tests further if possible though.