diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp index 4c6cffee05e5..fc162d0ef717 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp @@ -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; }