Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: relax test_file_system_space check for empty filesystems #2675

Closed
wants to merge 1 commit into from

Conversation

tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Mar 4, 2025

When statvfs reports information about a mounted filesystem, it populates a structure with several fields including:

  • f_blocks: the total data blocks in the filesystem
  • f_bfree: the available free blocks

On empty filesystems or those containing only empty files/directories, f_blocks and f_bfree can be identical since empty files and directories in Linux typically only consume inodes rather than data blocks.

This was causing test failures on Linux systems with no non-empty files under "/tmp":

/home/kefu/dev/seastar/tests/unit/file_io_test.cc(962): fatal error: in "test_file_system_space": critical check si.free < si.capacity has failed [100030640128 >= 100030640128]

This change relaxes the test to accommodate filesystems where all blocks are free, preventing false failures when "/tmp" contains no actual file data.

When statvfs reports information about a mounted filesystem, it populates
a structure with several fields including:

- f_blocks: the total data blocks in the filesystem
- f_bfree: the available free blocks

On empty filesystems or those containing only empty files/directories,
f_blocks and f_bfree can be identical since empty files and directories
in Linux typically only consume inodes rather than data blocks.

This was causing test failures on Linux systems with no non-empty files
under "/tmp":

```
/home/kefu/dev/seastar/tests/unit/file_io_test.cc(962): fatal error: in "test_file_system_space": critical check si.free < si.capacity has failed [100030640128 >= 100030640128]
```

This change relaxes the test to accommodate filesystems where all blocks
are free, preventing false failures when "/tmp" contains no actual file
data.

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov tchaikov requested a review from bhalevy March 4, 2025 03:55
@tchaikov
Copy link
Contributor Author

tchaikov commented Mar 4, 2025

@bhalevy hi Benny, could you please take a look at this change. i happened to run this test on my workstation right after it booted, and the test failed. hence this change.

@tchaikov
Copy link
Contributor Author

tchaikov commented Mar 4, 2025

@scylladb/seastar-maint hello maintainers, could you help merge this change?

@xemul xemul closed this in e788bd6 Mar 4, 2025
@tchaikov tchaikov deleted the statvfs-on-empty-fs branch March 8, 2025 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants