Skip to content

[v6] Update and fix transport tests #1496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Apr 27, 2025

Conversation

aymanbagabas
Copy link
Member

No description provided.

@aymanbagabas aymanbagabas requested review from Copilot and pjbgf April 8, 2025 12:52
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

plumbing/transport/http/dumb.go:71

  • [nitpick] Consider renaming the local variable 'url' to avoid shadowing the imported package 'net/url' for better clarity.
url, err := url.JoinPath(r.ep.String(), "objects", "info", "packs")

plumbing/transport/http/common.go:341

  • [nitpick] Consider renaming the local variable 'url' to avoid shadowing the imported package 'net/url', which can prevent potential confusion.
url, err := url.JoinPath(s.ep.String(), infoRefsPath)

@aymanbagabas aymanbagabas force-pushed the v6-transport-issues-tests branch 2 times, most recently from 1c495e0 to db78ae2 Compare April 8, 2025 19:07
@aymanbagabas aymanbagabas force-pushed the v6-transport-issues-tests branch from db78ae2 to 8f75151 Compare April 8, 2025 21:02
@aymanbagabas aymanbagabas force-pushed the v6-transport-issues-tests branch from 071a96a to 287ccf7 Compare April 8, 2025 22:24
@aymanbagabas aymanbagabas marked this pull request as draft April 10, 2025 06:19
@aymanbagabas
Copy link
Member Author

Will mark as ready once we figure out why these tests are failing. Looks like some sort of race conditions 🤔

Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

@aymanbagabas thank you for working on this.

For the failing tests, the error on Windows seems to be related to a file not being closed:

C:\Users\RUNNER~1\AppData\Local\Temp\TestDumbSuiteTestUploadPackWithContext3676574280\001\go-git-http-63925\basic.git\objects\pack\pack-a3fed42da1e8189a077c0e6846c040dcf73fc9dd.idx.temp3558511417: The process cannot access the file because it is being used by another process.

Looking into the source, I'd say the problem is the lack of a defer f.Close() after this.

For MacOS, my take the issue is that either by the time the daemon actually starts running the port is no longer available or the OS is not releasing the port fast enough for it to be reused.

PS: On a second execution the MacOS issue self-resolved. If this becomes a recurrent issue we may need to revisit this by potentially choosing not to bind the port in FreePort for that OS.

Comment on lines +305 to +306
// s.Require().NotNil(report, comment)
// s.Require().NoError(report.Error(), comment)
Copy link
Member

Choose a reason for hiding this comment

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

Is this commented while ReportStatus cap is implemented?

Copy link
Member Author

Choose a reason for hiding this comment

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

This used to test the ReportStatus response when it was returned during the ReceivePackSession routine. Now, ReportStatus responses are not exposed and handled during the new transport.ReceivePack. We can add tests to cover this case in follow-up PRs.

// s.Equal("ok", report.UnpackStatus)
// s.Len(report.CommandStatuses, 1)
// s.Equal(plumbing.ReferenceName("refs/heads/master"), report.CommandStatuses[0].ReferenceName)
// s.Require().Equal("ok", report.UnpackStatus)
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this to teh SendPack tests instead?

aymanbagabas and others added 6 commits April 27, 2025 01:22
Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>
Co-authored-by: Paulo Gomes <pjbgf@linux.com>
Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>
Co-authored-by: Paulo Gomes <pjbgf@linux.com>
Co-authored-by: Paulo Gomes <pjbgf@linux.com>
@aymanbagabas aymanbagabas marked this pull request as ready for review April 26, 2025 22:45
@aymanbagabas aymanbagabas requested a review from pjbgf April 26, 2025 22:46
@pjbgf pjbgf merged commit bd71b4e into go-git:v6-transport Apr 27, 2025
14 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.

2 participants