This is an archive of the discontinued LLVM Phabricator instance.

[Fortran/gfortran] Fix build-time and test-time race conditions
ClosedPublic

Authored by tarunprabhu on Jun 6 2023, 1:38 PM.

Details

Summary

There are currently several race conditions between tests in the test-suite which prevents them from being build and/or tested in parallel. Several tests produce the same module file at build-time while others create/read/write the same file at runtime. This patch does the following:

  1. A separate module directory is created for each test. Any .mod files produced by the test will be written into that module. In the case of multi-file tests, modules produced by any file will be written to that same directory.
  1. A separate working directory is created for each "execute" test and the test suite is instructed to run the test in that directory. The tests, as they are currently written, create/write/read files from $PWD. This ensures that files created by different tests do not conflict.
  1. The tests that were previously disabled because of these race conditions have been enabled.

Diff Detail

Repository
rT test-suite

Event Timeline

tarunprabhu created this revision.Jun 6 2023, 1:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2023, 1:38 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
tarunprabhu requested review of this revision.Jun 6 2023, 1:38 PM
tblah added a subscriber: tblah.Jun 7 2023, 5:12 AM
kiranchandramohan accepted this revision.Jun 7 2023, 7:39 AM

Nice. This change worked fine for me on an AArch64 machine. The idea of using a working directory to compile and run makes sense and would help avoid different tests with the same module name overwriting each other or tests that create files and writes/read from interfering with each other.

Fortran/gfortran/CMakeLists.txt
276–278

Makes sense.

This revision is now accepted and ready to land.Jun 7 2023, 7:39 AM