diff options
author | Will Chandler <wchandler@gitlab.com> | 2023-02-23 20:00:00 +0300 |
---|---|---|
committer | Will Chandler <wchandler@gitlab.com> | 2023-02-23 22:21:50 +0300 |
commit | ba14537e5412e53695cc3f9c41068c60d03856d1 (patch) | |
tree | c65aadf191676fe562a563b37fd8a285b984e8e0 /auth | |
parent | 1aef8477fffe8ef7a758de461b9667b50f8be6bd (diff) |
hooks: Fix flaky test on MacOS
We have observed intermittent failures on
`TestServer_PackObjectsHook_separateContext` on our MacOS runners. The
error occurs ~10% of the time on MacOS, but has been completely
unreproducible on Linux.
This appears to be a long-standing issue with FreeBSD, dating back to
2005[0], which MacOS has inherited. Unix domain sockets that are closed
after a partial read may return `ENOTCONN`, instead of `EPIPE` as seen
on Linux. This is exactly the scenario performed in this test.
Using the original reproduction script provided in the linked bug
report, the `ENOTCONN` issue occurs ~10% of the time, matching Gitaly's
failure rate.
Given that this functionality works as expected on Linux and the OS
itself is what is non-deterministic, the simplest fix is to accept
either `EPIPE` or `ENOTCONN` when on MacOS. We are forced to check for
the expected error string instead of `errors.Is(err, syscall.ENOTCONN)`
as the syscall information is lost when returned over gRPC to the test
program.
[0] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=79138
Diffstat (limited to 'auth')
0 files changed, 0 insertions, 0 deletions