Skip to content

Rewrite flaky test_vcs_url_urlquote_normalization to use local git repo #13243

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 2 commits into from
Feb 26, 2025

Conversation

ichard26
Copy link
Member

Guess who got fed up enough 🙃

Looking at the VCS code, I'm not actually sure if the original test is testing what's supposed to be testing nowadays. The docstring suggests it's testing the compare_urls() method in vcs/versioncontrol.py but it never called in the original test.

Anyway, this test has been particularly flaky as Launchpad frequently timeouts. We don't need to test bzr here, so let's switch to test against a local git repository.

Closes #13153.

@ichard26 ichard26 added the skip news Does not need a NEWS file entry (eg: trivial changes) label Feb 25, 2025
Comment on lines +527 to +529
pkg_path = _create_test_package(
script.scratch_path, name="django_wikiapp", vcs="git"
)
url = f"git+{pkg_path.as_uri().replace('django_', 'django%5F')}/#egg=django_wikiapp"
Copy link
Member Author

Choose a reason for hiding this comment

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

The _create_test_package helper is pretty rudimentary and will produce a package with broken entry-points if I use a dash (causing setuptools to loudly complain during package building), thus I had to switch it out for an underscore. Same idea, but different character.

@@ -520,25 +520,15 @@ def test_install_editable_from_bazaar(script: PipTestEnvironment) -> None:


@pytest.mark.network
Copy link
Member

Choose a reason for hiding this comment

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

Is network access still necessary with a local installation?

Copy link
Member Author

Choose a reason for hiding this comment

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

Normally installing from source requires internet access to download setuptools, but it turns out the legacy editable install mechanism is being used, thus, pip will use the already provisioned setuptools to build.

This may/will probably break once we remove the legacy editable mechanism, but honestly, I'd like to overhaul pip's end-to-end tests to avoid the network/prefer the local cache as much as possible anyway.

Looking at the VCS code, I'm not actually sure if the original test is
testing what's supposed to be testing nowadays. The docstring suggests
it's testing the compare_urls() method in vcs/versioncontrol.py but it
never called in the original test.

Anyway, this test has been particularly flaky as Launchpad frequently
timeouts. We don't need to test bzr here, so let's switch to test
against a local git repository.
@ichard26
Copy link
Member Author

I'll schedule merge this now as CI has been randomly failing too frequently. It's such a pain 🗑️ 🔥

Ugh, setuptools 75.8.1 now emits wheels with normalized filenames. It was released 6 hours, and now ~30 tests are broken 🙃

@ichard26 ichard26 enabled auto-merge (squash) February 26, 2025 05:01
@ichard26 ichard26 merged commit 83155a1 into pypa:main Feb 26, 2025
28 checks passed
notatallshaw pushed a commit to notatallshaw/pip that referenced this pull request Feb 27, 2025
…po (pypa#13243)

Looking at the VCS code, I'm not actually sure if the original test is
testing what's supposed to be testing nowadays. The docstring suggests
it's testing the compare_urls() method in vcs/versioncontrol.py but it
never called in the original test.

Anyway, this test has been particularly flaky as Launchpad frequently
timeouts. We don't need to test bzr here, so let's switch to test
against a local git repository.
@ichard26 ichard26 deleted the fix-flaky-test branch March 8, 2025 04:19
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip news Does not need a NEWS file entry (eg: trivial changes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intermittent CI failures due to Bazaar Launchpad upstream request timeouts
2 participants