[libcxx-commits] [libcxx] 4a19c11 - [libc++] Try fixing flaky fs.op.space test on FreeBSD (#213988)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Aug 5 03:07:17 PDT 2026


Author: Louis Dionne
Date: 2026-08-05T06:07:12-04:00
New Revision: 4a19c1129437bde0f37fc58f975f863e01726a7a

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

LOG: [libc++] Try fixing flaky fs.op.space test on FreeBSD (#213988)

As part of this test, we check the capacity available on the filesystem
and compare it against an expected capacity. However, on some
filesystems, the capacity is actually computed and may change depending
on filesystem usage. This creates a race condition since the disk may be
filling up (by e.g. other running tests) between the two calls.

For that same reason, other checks for the available size were using an
approximate equality up to a delta. Use the same approach for the
capacity here.

Added: 
    

Modified: 
    libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp
index 70079278711c4..c71c2a25342b2 100644
--- a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp
@@ -106,7 +106,7 @@ static void basic_space_test()
         space_info info = space(p, ec);
         assert(!ec);
         assert(info.capacity != bad_value);
-        assert(expect_capacity == info.capacity);
+        assert(EqualDelta(expect_capacity, info.capacity, delta));
         assert(info.free != bad_value);
         assert(EqualDelta(expect_free, info.free, delta));
         assert(info.available != bad_value);


        


More information about the libcxx-commits mailing list