#862 Fix flaky loadtxt test for int32 by adding sleep after savetxt. . #1057
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.
Added sleep calls to test_loadtxt.f90 to introduce delays between file operations. because before file was being read even before it was writeen and closed
Fixes #862
This PR addresses the intermittent failure of the
loadtxttest for int32,which occasionally produced:
End-of-file during read
Root cause:
The test wrote data to 'test_int32.txt' and immediately attempted to read
it with loadtxt.
Fix:
After every call to savetxt, a short delay has been added:
call sleep(1)
This ensures the file is fully written and stable before loadtxt reads it.
This is a beginner-friendly first fix; maintainers may later improve it
using proper file flushing.