mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
[GH-ISSUE #504] Improve test compatibility for 16K block size filesystems #222
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wszqkzqk on GitHub (Jun 15, 2025).
Original GitHub issue: https://github.com/bootandy/dust/issues/504
When building dust on systems using 16K filesystem block sizes, (tested on Arch Linux for Loong64) multiple tests fail during
cargo testdue to hardcoded 4K block size expectations. The test failures occur because Dust's output reflects actual disk usage (16K blocks), while tests expect 4K-based values.Affected Tests
Error Snippet:
It may be better to adapt to 16K block size in tests.
@bootandy commented on GitHub (Jun 16, 2025):
cry.
These are 'test_exact_output' tests. dust/tests/test_exact_output.rs
They already have an 'ubuntu' output and a 'mac_and_some_linux' output. I guess we could add support for 16K block size.
Perhaps I could work out what the block size is 'meant' to be from something like this:
https://serverfault.com/questions/29887/how-do-i-determine-the-block-size-of-an-ext3-partition-on-linux
and make the tests detect .
What do you think is best ?
We could hard code your above examples as another 'or' option in
main_outputand similar functions.@wszqkzqk commented on GitHub (Jun 16, 2025):
This does not seem to completely solve the problem, because users may also use other block sizes such as 32k and 64k.🤔🤔🤔
We may not be able to assume that the file system is ext2/3/4, perhaps we can try following command instead:
@bootandy commented on GitHub (Jun 20, 2025):
But realistically ? Is that likely ? - By the time users move away from 16K we'll have deprecated 4K. I also don't yet support 128 bit builds. But it's going to happen at some point.
The tests that fail show 'real' output - output as it exactly should be. That's why they are in the
test_exact_outputfile.So on reflection I don't want to use
statto try and calculate what the blocks 'should' be - (Although this would be ok to use in other test files), but not this one.So I think in the places in that file that say
vec![mac_and_some_linux, ubuntu]you should add16k_block_linuxto the list.