[NFC][sanitizer] Accept ETIMEDOUT in getpwnam_r_invalid_user.cpp (#186538)

On some systems, looking up an result in a timeout.

Error here is not a sign of compiler-rt issue.

Fixes flakiness on
https://lab.llvm.org/buildbot/#/builders/sanitizer-ppc64le-linux
This commit is contained in:
Vitaly Buka 2026-03-13 17:33:28 -07:00 committed by GitHub
parent 00885754d1
commit 5a87cba929
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,7 +16,8 @@ int main(void) {
int res = getpwnam_r("no-such-user", &pwd, buf, sizeof(buf), &pwdres);
fprintf(stderr, "Result: %d\n", res);
fflush(stderr);
assert(res == 0 || res == ENOENT);
// It can fail inconsistently on some bots with these errors.
assert(res == 0 || res == ENOENT || res == ETIMEDOUT);
assert(pwdres == 0);
return 0;
}