Skip to content

Conversation

@punithk-verse
Copy link

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 loadtxt test for int32,
which occasionally produced:

  • Fortran runtime error: Bad value during floating point read
    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.

Added sleep calls to test_loadtxt.f90 to introduce delays between file operations.   because before file was being read even before it was writen and closed
@codecov
Copy link

codecov bot commented Nov 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.13%. Comparing base (fffe0d7) to head (475ea9f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1057      +/-   ##
==========================================
+ Coverage   25.12%   25.13%   +0.01%     
==========================================
  Files         570      570              
  Lines      234201   234201              
  Branches    41277    41276       -1     
==========================================
+ Hits        58838    58871      +33     
+ Misses     175363   175330      -33     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

loadtxt test occasionally fails

1 participant