Skip to content

test(scenario): disable automatic git maintenance - #324

Merged
reuben olinsky (reubeno) merged 1 commit into
microsoft:mainfrom
binujp:bphilip/disable-repo-maintenance
Aug 26, 2026
Merged

test(scenario): disable automatic git maintenance#324
reuben olinsky (reubeno) merged 1 commit into
microsoft:mainfrom
binujp:bphilip/disable-repo-maintenance

Conversation

@binujp

@binujp binujp commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • disable automatic Git maintenance in generated scenario repositories
  • prevent transient .git/objects/maintenance.lock files from racing with the recursive container copy
  • keep short-lived test repository setup deterministic

Why

Dynamic scenario repositories are copied into containers immediately after creation. Automatic maintenance can create a transient lock while AddDirRecursive snapshots the repository and remove it before testcontainers opens the registered file. Repository maintenance is artificial for these short-lived fixtures, so disabling it removes the race without affecting the behavior under test.

Validation

  • mage fix all
  • affected scenario package, including TestRenderWithPatchSidecar, passed under mage scenario
  • unrelated container-framework packages encountered the existing container image AlreadyExists race

Dynamic scenario repositories are copied into containers immediately after they are created. Automatic Git maintenance can create a transient maintenance.lock while AddDirRecursive snapshots the repository, then remove it before the container copy opens the file.

Repository maintenance is artificial for these short-lived test fixtures, so disable it to eliminate the race and keep scenario setup deterministic.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 229a102b-9849-43cd-a78a-88775ac9cc47
Copilot AI lite review requested due to automatic review settings August 26, 2026 07:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes scenario test repositories deterministic by disabling Git’s automatic maintenance in dynamically generated fixture repos, eliminating a race where transient .git/objects/maintenance.lock files can appear during container copy.

Changes:

  • Add git config maintenance.auto false during scenario repo initialization to prevent auto-maintenance from creating transient lock files.
  • Document the motivation inline near the git setup commands to clarify the race being avoided.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@reubeno
reuben olinsky (reubeno) merged commit 625b968 into microsoft:main Aug 26, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants