Skip to content

Remove too-strict filestore available size test #1203

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

Merged
merged 1 commit into from
Jun 2, 2020

Conversation

dbwiddis
Copy link
Contributor

The test that usable space equals available space on a filestore is too strict, as it can fail in a race condition between fetching statvfs and getting the same information from core Java:

assertEquals(fstore.getUsableSpace(), vfs.f_bavail.longValue() * vfs.f_bsize.longValue());

Failed test:

    [junit] Testcase: testStatvfs(com.sun.jna.platform.linux.LibCTest):	FAILED
    [junit] expected:<816184561664> but was:<816175988736>

In theory we could test for something "close" but any change threshold we choose would be arbitrary. Given the previous line checks equality of total space, which should not change, I think this test can simply be removed.

@matthiasblaesing
Copy link
Member

Sounds sane.

@matthiasblaesing matthiasblaesing merged commit 1e86b54 into java-native-access:master Jun 2, 2020
@dbwiddis dbwiddis deleted the fsavailfix branch January 11, 2022 22:13
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.

2 participants