Skip to content

Remove too-strict filestore available size test#1203

Merged
matthiasblaesing merged 1 commit intojava-native-access:masterfrom
dbwiddis:fsavailfix
Jun 2, 2020
Merged

Remove too-strict filestore available size test#1203
matthiasblaesing merged 1 commit intojava-native-access:masterfrom
dbwiddis:fsavailfix

Conversation

@dbwiddis
Copy link
Copy Markdown
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
Copy Markdown
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