hg: read rejects file contents in-memory (Bug 2031725)#1089
Closed
cgsheeh wants to merge 2 commits intomozilla-conduit:mainfrom
Closed
hg: read rejects file contents in-memory (Bug 2031725)#1089cgsheeh wants to merge 2 commits intomozilla-conduit:mainfrom
cgsheeh wants to merge 2 commits intomozilla-conduit:mainfrom
Conversation
Use of the hard-coded `/tmp/rejects_path` directory to store `.rej` file contents causes intermittent test failures during parallelized test runs. Tests will attempt to clear the directory during `clean_repo` and the later read file contents in `process_merge_conflicts`, causing several different intermittent failures from this single issue. Change `HgSCM` to read the rejects content into an in-memory instance variable, which is initialized empty and cleared at the same time the previous implementation would `rmdir` the directory. Move logic to an instance method and add a unit test for the parsing logic. Expand tests to ensure parsing cannot fail on invalid UTF-8, and that the in-memory rejects are properly parsed on `PatchConflict`.
|
View this pull request in Lando to land it once approved. |
shtrom
approved these changes
Apr 16, 2026
|
|
||
| def __init__(self, path: str, config: dict | None = None, **kwargs): | ||
| self.config = copy.copy(self.DEFAULT_CONFIGS) | ||
| self.rejects_content: dict[str, str] = {} |
Member
There was a problem hiding this comment.
nit: Could we forward-declare this attribute at the top of the class definition?
lando-worker bot
pushed a commit
that referenced
this pull request
Apr 16, 2026
Use of the hard-coded `/tmp/rejects_path` directory to store `.rej` file contents causes intermittent test failures during parallelized test runs. Tests will attempt to clear the directory during `clean_repo` and the later read file contents in `process_merge_conflicts`, causing several different intermittent failures from this single issue. Change `HgSCM` to read the rejects content into an in-memory instance variable, which is initialized empty and cleared at the same time the previous implementation would `rmdir` the directory. Move logic to an instance method and add a unit test for the parsing logic. Expand tests to ensure parsing cannot fail on invalid UTF-8, and that the in-memory rejects are properly parsed on `PatchConflict`. Pull request: #1089
|
Pull request closed by commit 24ea73f |
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.
Use of the hard-coded
/tmp/rejects_pathdirectory to store.rejfile contents causes intermittent test failures duringparallelized test runs. Tests will attempt to clear the
directory during
clean_repoand the later read file contentsin
process_merge_conflicts, causing several differentintermittent failures from this single issue.
Change
HgSCMto read the rejects content into an in-memoryinstance variable, which is initialized empty and cleared at
the same time the previous implementation would
rmdirthedirectory. Move logic to an instance method and add a unit test
for the parsing logic. Expand tests to ensure parsing cannot fail on
invalid UTF-8, and that the in-memory rejects are properly
parsed on
PatchConflict.