Skip to content

Commit 81349b8

Browse files
authored
[sanitizer] Use /tmp/ not /tmp/dir/ in tests (#117759)
Tests fail if the user doesn't own /tmp/dir/. On hosts with multiple users running the test suite, who owns /tmp/dir/ can become a race.
1 parent dde7f4d commit 81349b8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,7 @@ TEST(SanitizerCommon, ReportFile) {
345345
SpinMutex report_file_mu;
346346
ReportFile report_file = {&report_file_mu, kStderrFd, "", "", 0};
347347
char tmpfile[128];
348-
temp_file_name(tmpfile, sizeof(tmpfile),
349-
"dir/sanitizer_common.reportfile.tmp.");
348+
temp_file_name(tmpfile, sizeof(tmpfile), "sanitizer_common.reportfile.tmp.");
350349
report_file.SetReportPath(tmpfile);
351350
const char *path = report_file.GetReportPath();
352351
EXPECT_EQ(internal_strncmp(tmpfile, path, strlen(tmpfile)), 0);

0 commit comments

Comments
 (0)