-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
gitoxide auth tests sporadically failing #11821
Comments
@Byron This seems to be happening fairly frequently. Would it be possible to ignore these tests or disable the gitoxide tests until this is fixed? |
For context, what happens here is that What's even stranger is that Let me also ignore write failures (just like git does) and submit a PR with a |
They might ignore all input and output hardcoded credentials for good reason, so we don't validate writes to the helper similarly to how git does it. Note that we also don't care if credentials are stored or erased for similar reasons. I would happily make the case that we should be more adamant about error handling in that case, but typically we check error codes and that's the only indicator for success or failure. Related to rust-lang/cargo#11821
The proper fix is in https://github.com/Byron/gitoxide/releases/tag/gix-v0.41.0 which unfortunately can't be used as it also comes with the latest `tempfile` v3.4 which causes other issues when compiling on some platforms. Thus we first disable the flaky tests, and re-enable them with the `gix` upgrade which should be possible once `tempfile` doesn't hinder `cargo` on some platforms anymore. Related to rust-lang#11821
This reverts commit c890c64.
This is more complicated than it has any right to be, but here we are.
Are there better ways to do this? This is the only way I see unfortunately. |
upgrade `gix` to v0.41 to fix flaky auth tests and revert commit c890c64. The latest release (https://github.com/Byron/gitoxide/releases/tag/gix-v0.41.0) makes writing to the credential helper non-fallible which is useful if the helper program doesn't read from stdin and is in line with of `git` implements it as well. This fix also undoes a pin `tempfile` to version 3.3 which at this time causes build issues for some platforms if `tempfile` version 3.4 or newer would be used. Thus this PR cannot be merged until `tempfile` will not cause build failures. This also means that `cargo` can't upgrade to any newer version of `gitoxide` until `tempfile` isn't an issue anymore, also blocking the shallow clone feature for example. @weihanglo, maybe you can replace this line with references to issues to wait for.
Disable flaky auth tests when `gitoxide` runs them The proper fix is in https://github.com/Byron/gitoxide/releases/tag/gix-v0.41.0 which unfortunately can't be used as it also comes with the latest `tempfile` v3.4 which causes other issues when compiling on some platforms. Thus we first disable the flaky tests, and re-enable them with the `gix` upgrade which should be possible once `tempfile` doesn't hinder `cargo` on some platforms anymore. Related to #11821 This PR is supposed to be followed up by #11831 which re-enables the flaky tests and fixes them properly by upgrading `gix` which contains the fix.
upgrade `gix` to v0.41 to fix flaky auth tests and revert commit c890c64. The latest release (https://github.com/Byron/gitoxide/releases/tag/gix-v0.41.0) makes writing to the credential helper non-fallible which is useful if the helper program doesn't read from stdin and is in line with of `git` implements it as well. This fix also undoes a pin `tempfile` to version 3.3 which at this time causes build issues for some platforms if `tempfile` version 3.4 or newer would be used. Thus this PR cannot be merged until `tempfile` will not cause build failures. This also means that `cargo` can't upgrade to any newer version of `gitoxide` until `tempfile` isn't an issue anymore, also blocking the shallow clone feature for example. @weihanglo, maybe you can replace this line with references to issues to wait for.
upgrade `gix` to v0.41 to fix flaky auth tests and revert commit c890c64. The latest release (https://github.com/Byron/gitoxide/releases/tag/gix-v0.41.0) makes writing to the credential helper non-fallible which is useful if the helper program doesn't read from stdin and is in line with of `git` implements it as well. This fix also undoes a pin `tempfile` to version 3.3 which at this time causes build issues for some platforms if `tempfile` version 3.4 or newer would be used. Thus this PR cannot be merged until `tempfile` will not cause build failures. This also means that `cargo` can't upgrade to any newer version of `gitoxide` until `tempfile` isn't an issue anymore, also blocking the shallow clone feature for example. @weihanglo, maybe you can replace this line with references to issues to wait for.
This was fixed by #11840 apparently, as it hasn't happened for a long while. Closing. |
@weihanglo Doesn't #11830 need to be reverted? |
Hmm… we didn't? |
This reverts commit c890c64. gix was updated to 0.41.0 (and later) a while back. Let's see how it goes.
The old failure should be gone but there is a new one on Windows. See #13116 (comment). Feel free to take over it. |
I was actually convinced that something was indeed reverted in the shallow-clones PR, but judging by this PR on Windows strange things are still happening. To me it seems that it would already be an improvement to enable the two disabled tests on all platforms but windows for now, and I can work on a way to let library users control what happens to I will probably submit a PR for this tomorrow as the issue on windows seems fixable, so we can finally close this issue here. |
Sounds good to me for either disabling or fixing the test on Windows. Thank you for taking a look at it! |
Great! I gave it a quick shot but wasn't lucky enough for my 'fix' to fully work. This means |
This release disables stderr for external programs by default, while allowing to override these settings using configuration or environment variables.
This release disables stderr for external programs by default, while allowing to override these settings using configuration or environment variables.
On Windows, `gix` will call the `git-credential-manager, but with `stderr` set to `inherit` it makes any errors visible to the user, just like `git` does. ``` 1 1 Updating git repository `https://foo.bar/foo/bar` 2 +warning: auto-detection of host provider took too long (>2000ms) 3 +warning: see https://aka.ms/gcm/autodetect for more information. 4 +fatal: A task was canceled. 5 +warning: auto-detection of host provider took too long (>2000ms) 6 +warning: see https://aka.ms/gcm/autodetect for more information.` ```` This, however, isn't what's desirable in tests sometimes, nor may it be desirable in Cargo. In the latest version of `gix`, it's possible to control `stderr` which is now set on a per-test basis. Also note that for `cargo` as a whole the default didn't change, and stderr of spawned helper programs will remain visible in the enclosing terminal.
re-enable previously disabled tests with Windows-specific fix Related to #11821 for which this is a fix. However, it's probably not yet the optimal solution, depending on how `stderr` of subprocesses should be handled. ### Tasks * [x] try to fix the issue with an env var. - Failure, as one warning remains that seems to originate from a C# HTTP client * [x] figure out if `stderr` should be on or off by default - on by default like before, but now one can control it. * [x] create a new `gix` release and use it here ### Review Notes * Personally, I think `cargo` should keep `stderr` to be inherited so users can see potentially relevant warnings or errors provided by credential helpers. Thus this is still the default, but the tests that need it explicitly disabled `stderr` of credential helpers. ---- On Windows, `gix` will call the `git-credential-manager, but with `stderr` set to `inherit` which makes any errors visible to the user, just like `git` does. ``` 1 1 Updating git repository `https://foo.bar/foo/bar` 2 +warning: auto-detection of host provider took too long (>2000ms) 3 +warning: see https://aka.ms/gcm/autodetect for more information. 4 +fatal: A task was canceled. 5 +warning: auto-detection of host provider took too long (>2000ms) 6 +warning: see https://aka.ms/gcm/autodetect for more information.` ```` This, however, isn't what's desirable in tests sometimes, nor may it be desirable in Cargo. For now, it seems easiest to disable this particular feature that issues the warning messages, even though a future `gix` update should allow to control what to do with `stderr`.
Reopen. See #13129 |
The quick-shot must have missed :/. Admittedly I was flying blind and didn't validate that it works locally. I will try again and see what the problem is (this time with validation), as right now is a good time to try to tackle it as I can still make a point release of whichever crates are affected in the fix. |
) With `gix-config` now being fixed, it will properly respect `GIT_CONFIG_NOSYSTEM` both for system-wide configuration as well as for the git installation configuration. That way, credential helpers provided by the git installation won't be called anymore, which prevents them from 'somehow' emitting information to stderr. The latter was previously disabled for credential helpers, and despite everything^1 looking like it should work, it simply didn't. [1]: rust-lang#13117 (comment)
re-enable flaky tests thanks to update to `gix-config`. (#11821) Related to #11821. With `gix-config` now being fixed, it will properly respect `GIT_CONFIG_NOSYSTEM` both for system-wide configuration as well as for the git installation configuration. That way, credential helpers provided by the git installation won't be called anymore, which prevents them from 'somehow' emitting information to stderr. The latter was previously disabled for credential helpers, and despite [everything looking like it should work][1], it simply didn't. [1]: #13117 (comment)
Update cargo 12 commits in 9787229614b27854cf73d57ffae430d7c1e6caa4..6feabf94773286928b7d73d0d313c0c5562b66af 2023-12-06 02:29:23 +0000 to 2023-12-08 22:38:37 +0000 - fix: explicitly remap current dir by using `.` (rust-lang/cargo#13114) - Don't rely on mtime to test changes (rust-lang/cargo#13143) - refactor: Pull PackageIdSpec into schema (rust-lang/cargo#13128) - fix: Print rustc messages colored on wincon (rust-lang/cargo#13140) - Add a windows manifest file (rust-lang/cargo#13131) - Avoid writing CACHEDIR.TAG if it already exists (rust-lang/cargo#13132) - re-enable flaky tests thanks to update to `gix-config`. (rust-lang/cargo#11821) (rust-lang/cargo#13130) - fix bash completion in directory with spaces (rust-lang/cargo#13126) - test: re-ignore git auth tests for gitoxide (rust-lang/cargo#13129) - fix(toml): Disallow inheriting of dependency public status (rust-lang/cargo#13125) - re-enable previously disabled tests with Windows-specific fix (rust-lang/cargo#13117) - refactor: Clarify PackageId constructor names (rust-lang/cargo#13123) r? ghost
Update cargo 13 commits in 9787229614b27854cf73d57ffae430d7c1e6caa4..66ad359b408ccdf867cceb30cc2dff1ed4afd82d 2023-12-06 02:29:23 +0000 to 2023-12-09 12:30:01 +0000 - chore: downgrade to openssl v1.1.1 (rust-lang/cargo#13144) - fix: explicitly remap current dir by using `.` (rust-lang/cargo#13114) - Don't rely on mtime to test changes (rust-lang/cargo#13143) - refactor: Pull PackageIdSpec into schema (rust-lang/cargo#13128) - fix: Print rustc messages colored on wincon (rust-lang/cargo#13140) - Add a windows manifest file (rust-lang/cargo#13131) - Avoid writing CACHEDIR.TAG if it already exists (rust-lang/cargo#13132) - re-enable flaky tests thanks to update to `gix-config`. (rust-lang/cargo#11821) (rust-lang/cargo#13130) - fix bash completion in directory with spaces (rust-lang/cargo#13126) - test: re-ignore git auth tests for gitoxide (rust-lang/cargo#13129) - fix(toml): Disallow inheriting of dependency public status (rust-lang/cargo#13125) - re-enable previously disabled tests with Windows-specific fix (rust-lang/cargo#13117) - refactor: Clarify PackageId constructor names (rust-lang/cargo#13123)
Update cargo 20 commits in 9787229614b27854cf73d57ffae430d7c1e6caa4..1aa9df1a5be205cce621f0bc0ea6062a5e22a98c 2023-12-06 02:29:23 +0000 to 2023-12-12 14:52:31 +0000 - crates-io: Add support for other 2xx HTTP status codes (rust-lang/cargo#13158) - Remove the deleted feature test_2018_feature from the test (rust-lang/cargo#13156) - refactor(schema): Remove reliance on cargo types (rust-lang/cargo#13154) - fix(toml)!: Disallow `[lints]` in virtual workspaces (rust-lang/cargo#13155) - Limit exported-private-dependencies lints to libraries (rust-lang/cargo#13135) - chore: update to [email protected] (rust-lang/cargo#13148) - Update curl-sys to bring in curl 8.5.0 (rust-lang/cargo#13147) - chore: downgrade to openssl v1.1.1 (rust-lang/cargo#13144) - fix: explicitly remap current dir by using `.` (rust-lang/cargo#13114) - Don't rely on mtime to test changes (rust-lang/cargo#13143) - refactor: Pull PackageIdSpec into schema (rust-lang/cargo#13128) - fix: Print rustc messages colored on wincon (rust-lang/cargo#13140) - Add a windows manifest file (rust-lang/cargo#13131) - Avoid writing CACHEDIR.TAG if it already exists (rust-lang/cargo#13132) - re-enable flaky tests thanks to update to `gix-config`. (rust-lang/cargo#11821) (rust-lang/cargo#13130) - fix bash completion in directory with spaces (rust-lang/cargo#13126) - test: re-ignore git auth tests for gitoxide (rust-lang/cargo#13129) - fix(toml): Disallow inheriting of dependency public status (rust-lang/cargo#13125) - re-enable previously disabled tests with Windows-specific fix (rust-lang/cargo#13117) - refactor: Clarify PackageId constructor names (rust-lang/cargo#13123)
I feel confident to close this via #13130 this time. |
Some of the gitoxide tests seem to be randomly failing in CI:
The errors look like:
The text was updated successfully, but these errors were encountered: