Skip to content

Commit b9602f3

Browse files
committed
t/t-credentials: avoid failing flakily when run in parallel
We've noticed that this test has become flaky sometimes and fails in CI. More recently, a distributor noticed that this test fails consistently when run with 4 jobs at a time with `prove`. Not all of the tests fail every time, but at least one of them does. Part of the relevant difference is that our netrc tests use `localhost` as the machine name instead of the default 127.0.0.1. This is helpful, because it means we don't call the credential helper, when we really want to fall back to the askpass code. That's because we use different credentials for the `netrctest` remote, so if there were credentials available for `localhost`, we'll fail since we'll provide the wrong ones. The reason, therefore, that this test is flaky is that the clone code creates an entry for the credential helper for `localhost`, and the credential directory is shared among tests. Thus, `t-credentials.sh` fails whenever these tests run concurrently. The obvious solution is to simply create a per-test credentials directory so that we aren't affected by what other tests are doing. Let's do that, which makes this test pass consistently.
1 parent b326b63 commit b9602f3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

t/t-credentials.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
ensure_git_version_isnt $VERSION_LOWER "2.3.0"
66

7+
export CREDSDIR="$REMOTEDIR/creds-credentials"
8+
setup_creds
9+
710
begin_test "credentials with url-specific helper skips askpass"
811
(
912
set -e

0 commit comments

Comments
 (0)