tests: avoid stale test file parts on retries - #22319
Closed
GrahamCampbell wants to merge 2 commits into
Closed
Conversation
Contributor
|
Good catch! Not just the memoized output but the cached xml file would be affected, as you've identified. I need to think for a moment if this solution is sufficient in the case of parallel tests. |
dfandrich
requested changes
Jul 14, 2026
dfandrich
left a comment
Contributor
There was a problem hiding this comment.
I don't see parallel tests affecting this. The selection of servers is done in the runner as is the variable substitution, so the effects should be contained within the runner process. This looks like a good solution to this.
GrahamCampbell
force-pushed
the
tests-retry-reload
branch
from
July 15, 2026 21:05
3b3ddb2 to
c86ca7f
Compare
GrahamCampbell
marked this pull request as ready for review
July 15, 2026 21:08
dfandrich
approved these changes
Jul 15, 2026
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.
getpartandgetpartattrresults are memoized keyed on section, part and filename (2039253). When a test is retried,singletest_preprocessregenerates the preprocessed file with fresh variable substitutions, such as a new server port, but the stale cached parts keep being returned, so retries reuse the old port and--retrycannot recover. One flaky hit of test 798 (the root cause of which I fixed in #22318) thus became five identical failures and a red job.This PR adjusts
loadtestto flush the memoized caches whenever it actually reads a file, andsingletest_preprocessto force the reload past the already-loaded check. Repeated same-file calls still return early with a warm cache.The same staleness also exists in
ftpserver.pl, which holds its own copy of these caches in a long lived process and leans on the already-loaded check in every command handler. A retry landing on the same runner would keep serving the previous attempt's file, and that predates the memoization since the check also keeps the old file contents. The server now forces a reload whenever a client connects, while lookups within a connection stay warm.