Skip to content

Commit

Permalink
[libc] Fix file collision causing test flake (llvm#106119)
Browse files Browse the repository at this point in the history
In patch llvm#105293 tests for vfscanf were added, meant to be identical to
the fscanf tests. Unfortunately, the author forgot to rename the target
file causing an occasional test flake where one test writes to the file
while the other is trying to read it. This patch fixes the issue by
renaming the target test file for the vfscanf test.
  • Loading branch information
michaelrj-google authored Aug 26, 2024
1 parent a35398d commit bfc7540
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libc/test/src/stdio/vfscanf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ static int call_vfscanf(::FILE *stream, const char *__restrict format, ...) {
return ret;
}

TEST(LlvmLibcFScanfTest, WriteToFile) {
const char *FILENAME = "fscanf_output.test";
TEST(LlvmLibcVFScanfTest, WriteToFile) {
const char *FILENAME = "vfscanf_output.test";
auto FILE_PATH = libc_make_test_file_path(FILENAME);
::FILE *file = scanf_test::fopen(FILE_PATH, "w");
ASSERT_FALSE(file == nullptr);
Expand Down

0 comments on commit bfc7540

Please sign in to comment.