[libc-commits] [libc] bfc7540 - [libc] Fix file collision causing test flake (#106119)

via libc-commits libc-commits at lists.llvm.org
Mon Aug 26 12:04:27 PDT 2024


Author: Michael Jones
Date: 2024-08-26T12:04:24-07:00
New Revision: bfc7540e15e29ba5e73cdeb22a825138f1be609a

URL: https://github.com/llvm/llvm-project/commit/bfc7540e15e29ba5e73cdeb22a825138f1be609a
DIFF: https://github.com/llvm/llvm-project/commit/bfc7540e15e29ba5e73cdeb22a825138f1be609a.diff

LOG: [libc] Fix file collision causing test flake (#106119)

In patch #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.

Added: 
    

Modified: 
    libc/test/src/stdio/vfscanf_test.cpp

Removed: 
    


################################################################################
diff  --git a/libc/test/src/stdio/vfscanf_test.cpp b/libc/test/src/stdio/vfscanf_test.cpp
index 7a9cbf7f123880..fa4e27582375f8 100644
--- a/libc/test/src/stdio/vfscanf_test.cpp
+++ b/libc/test/src/stdio/vfscanf_test.cpp
@@ -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);


        


More information about the libc-commits mailing list