diff options
author | Martin Ågren <martin.agren@gmail.com> | 2020-03-08 09:46:27 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-03-09 08:05:13 -0700 |
commit | 4605a7307352c41ea83939d53d31f69cdd3fa3ec (patch) | |
tree | 30043ed0421aeecea7e5532668966317635dbc41 /t/t5532-fetch-proxy.sh | |
parent | sparse-checkout: allow one-character directories in cone mode (diff) | |
download | tgif-4605a7307352c41ea83939d53d31f69cdd3fa3ec.tar.xz |
t1091: don't grep for `strerror()` string
We grep for "File exists" in stderr of the failing `git sparse-checkout`
to make sure that it failed for the right reason. We expect the string
to show up there since we call `strerror(errno)` in
`unable_to_lock_message()` in lockfile.c.
On the NonStop platform, this fails because the error string is "File
already exists", which doesn't match our grepping.
See 9042140097 ("test-dir-iterator: do not assume errno values",
2019-07-30) for a somewhat similar fix. There, we patched a test helper,
which meant we had access to `errno` and could investigate it better in
the test helper instead of just outputting the numerical value and
evaluating it in the test script. The current situation is different,
since (short of modifying the lockfile machinery, e.g., to be more
verbose) we don't have more than the output from `strerror()` available.
Except we do: We prefix `strerror(errno)` with `_("Unable to create
'%s.lock': ")`. Let's grep for that part instead. It verifies that we
were indeed unable to create the lock file. (If that fails for some
other reason than the file existing, we really really should expect
other tests to fail as well.)
An alternative fix would be to loosen the expression a bit and grep for
"File.* exists" instead. There would be no guarantee that some other
implementation couldn't come up with another error string, That is, that
could be the first move in an endless game of whack-a-mole. Of course,
it could also take us from "99" to "100" percent of the platforms and
we'd never have this problem again. But since we have another way of
addressing this, let's not even try the "loosen it up a bit" strategy.
Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5532-fetch-proxy.sh')
0 files changed, 0 insertions, 0 deletions