Do not report file input rewind if nothing was read repeatedly. #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some tests require a fixed amount of data.
Currently, with file input, if the size is exact, the file rewind is reported, although nothing is being read repeatedly (only EOF was reached).
The file must contain more bytes than needed to avoid it.
As we use the file rewind message to detect problems with input size, this patch modifies the rewind count function not to detect rewind if nothing has been read repeatedly yet.
The function is used in output.c only, this seems the simplest solution.
Simple reproducible with the DBA OPSO2 test that requires exactly 256M:
dd if=/dev/urandom of=test.img bs=1M count=256
dieharder -d 211 -g 201 -f test.img
This message appears
The file file_input_raw was rewound 1 times
Adding 4 more bytes (that are never read), the test is happy again
truncate -s 268435460 test.img
With this patch, adding more data is no longer needed, while real rewind reads are still reported.