Skip to content

fix git config not present for certain tests#6431

Merged
jakecoffman merged 1 commit intomainfrom
jakecoffman/fix-common-rspec-race
Jan 13, 2023
Merged

fix git config not present for certain tests#6431
jakecoffman merged 1 commit intomainfrom
jakecoffman/fix-common-rspec-race

Conversation

@jakecoffman
Copy link
Copy Markdown
Member

@jakecoffman jakecoffman commented Jan 13, 2023

In #6424 I moved the git config into the tests, but didn't realize there are some tests that run git commit directly like this one:

Dir.chdir(repo_path) do
`git init .`
fill_repo
`git add .`
`git commit --allow-empty -m'fake clone source'`
end

This is resulting in racy failures in CI where the git config hasn't been set globally yet.

By moving this out of the function it will run as soon as it's required which should fix that problem. It's a bit of a naive solution though so I am not opposed to other ideas.

@jakecoffman jakecoffman requested a review from a team as a code owner January 13, 2023 19:12
Copy link
Copy Markdown
Member

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

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

Makes sense to me.

@jakecoffman jakecoffman merged commit 9a941db into main Jan 13, 2023
@jakecoffman jakecoffman deleted the jakecoffman/fix-common-rspec-race branch January 13, 2023 19:37
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.

2 participants